Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle searching for zip instead of jar

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.

like image 304
Fletch Avatar asked Aug 31 '12 12:08

Fletch


1 Answers

If you are using Grails' BuildConfig.groovy for resolution, there are two dependency resolution blocks, a dependencies block and a plugins block. Make sure your declaration is inside the dependencies block. If it is accidentally placed in the plugins block it will look for a packaged plugin, which are packaged as a .zip file.

like image 186
schmolly159 Avatar answered Oct 16 '22 14:10

schmolly159