I want to include Apache commons-math 3.0 in my (Grails) project. So I put the following in my dependencies:
compile "org.apache.commons:commons-math3:3.0"
It’s in the central maven repository, see http://central.maven.org/maven2/org/apache/commons/commons-math3/3.0/
Gradle gives me the error
::::::::::::::::::::::::::::::::::::::::::::::
:: FAILED DOWNLOADS ::
:: ^ see resolution messages for details ^ ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.apache.commons#commons-math3;3.0!commons-math3.zip
::::::::::::::::::::::::::::::::::::::::::::::
and includes among others:
==== mavenCentral: tried
http://repo1.maven.org/maven2/org/apache/commons/commons-math3/3.0/commons-math3-3.0.zip
So it appears to be looking in the right place, but why is it looking for the zip instead of the jar? The Gradle doco says that jar is the default thing to search for. I even tried using “artifact only notation” with the @ sign to get the jar (as described at http://gradle.org/docs/current/userguide/dependency_management.html) but it still only searches for the zip.
If you are using Grails’
BuildConfig.groovyfor resolution, there are two dependency resolution blocks, adependenciesblock and apluginsblock. Make sure your declaration is inside thedependenciesblock. If it is accidentally placed in thepluginsblock it will look for a packaged plugin, which are packaged as a.zipfile.