How to exclude parent poms from dependency resolution for maven artifact?


(Laim Kollector) #1

Hello,

I’d like to download artifact from internal maven repository but the build fails due to dependency resolution problems. Artifact’s pom has parent which has a parent of its own, it looks like:

projectA - projectB – projectC

Artifact from projectC is the one I want to pull out from repository, that simple. But build fails because of dependency resolution problem for parent project (version of parent project is set to RELEASE in pom for artifact I want to download)

So, how do I exclude those parent projects (projectA and projectB) from dependency resolution? I’ve already set transitive=false for configuration.

Environment

Gradle 1.0-rc-1 ------------------------------------------------------------

Gradle build time: Wednesday, April 11, 2012 11:13:24 AM UTC Groovy: 1.8.6 Ant: Apache Ant™ version 1.8.2 compiled on December 20 2010 Ivy: 2.2.0 JVM: 1.6.0_31 (Sun Microsystems Inc. 20.6-b01) OS: Windows 7 6.1 x86

Thanks in advance!


How to deal with parent artifact with version RELEASE
(Peter Niederwieser) #2

Best solution is to fix the POM. You can try @jar notation or a client module dependency (both described in the Gradle user guide ) to work around the invalid POM, but I’m not completely sure if it will work.


(Laim Kollector) #3

POMs are OK in terms of Maven build (I guess) but this is indeed the best solution available at the moment to make Gradle build run. Thank you!


(Peter Niederwieser) #4

A version of RELEASE doesn’t sound right.


(Aram Zamora) #5

How did you solve it? with the @jar? I cannot fix the POM, it belongs to other module.