WAR dependencies in artifactory resolve with Maven but not Gradle

Hi,

This is a somewhat unusual problem to me as I have never known a dependency management system to be picky regarding the type of files it is resolving.

We are using Gradle 2.10 and Artifactory 3.80 as the dependency management repository.

We are building a project installer using Gradle, and are migrating some of the dependency resolution from Maven to Gradle. All resolutions seem to work fine except for the resources that are of type “war”.

Running a “gradle dependencies” produces results similar to the following:

compile - Compile classpath for source set ‘main’.
Download http://xxx.com:8081/artifactory/libs-releases/org/geoserver/web/2.5.1/web-2.5.1.pom
±-- org.geoserver:geoserver:2.5.1 FAILED
±-- org.geoserver.extensions:control-flow-plugin:2.5.1
±-- org.eclipse.jetty:jetty-distribution:9.3.6.v20151106
— org.postgis:postgis-bundle-pg93x64:2.1.5-1

This is not a question of missing dependencies as they are available and have been download using Maven countless times, and other dependencies are resolving correctly so connectivity is working.

My dependencies are as follows:

dependencies {
compile group: ‘org.geoserver’, name: ‘geoserver’, version: ‘2.5.1’, ext: 'war’
compile group: ‘org.geoserver.extensions’, name: ‘control-flow-plugin’, version: ‘2.5.1’, ext: 'zip’
compile group: ‘org.eclipse.jetty’, name: ‘jetty-distribution’, version: ‘9.3.6.v20151106’, ext: 'zip’
compile group: ‘org.postgis’, name: ‘postgis-bundle-pg93x64’, version: ‘2.1.5-1’, ext: 'zip’
testCompile group: ‘junit’, name: ‘junit’, version: ‘4.11’
}

Any help or suggestions would be greatly appreciated.

Thanks,
Mo

Trying running you build with --info, it should provide information on what artifacts it’s trying to download. That said, it looks like it download a POM for a module named ‘web’ but your dependency is for a module named ‘geoserver’.

Thanks Mark.

I think the problem is that there is a cyclic dependency were geoserver pom has a dependency to the geoserver.web which has a dependency back to geoserver. Even though maven picks up this transitive dependency, flags it as a problem in the pom, it still continues to download the geoserver war file.

However gradle is not so forgiving and fails to download the war file even if transitive is set to false to prevent transitive dependencies from being downloaded. I am not sure there would be a way around this other than to bundle these dependencies in a single archive and download and then process the required files, etc.

I am not sure if gradle is built to behave like this by design or if this is a bug in gradle. If you think it is a bug I will log it.

Cheers
Mo