0

My project depends on the Pax Exam framework. I declare, among others, these dependencies on Pax (PAX_EXAM_VERSION = 3.4.0):

compile group: 'org.ops4j.pax.exam', name: 'pax-exam-junit4', version: PAX_EXAM_VERSION
compile group: 'org.ops4j.pax.exam', name: 'pax-exam-container-native', version: PAX_EXAM_VERSION

Both of these depend on org.ops4j.pax.exam:pax-exam-spi, which is the module causing my issue.

So, when I try to build my project, the error reported is this one:

Could not resolve org.ops4j.pax.exam:pax-exam-spi:3.4.0 ... Could not parse POM http://repo.maven.apache.org/maven2/org/ops4j/pax/exam/pax-exam-spi/3.4.0/pax-exam-spi-3.4.0.pom Unable to resolve version for dependency 'com.google.guava:guava:jar'

I have tried:

  • excluding pax-exam-spi from the transitive dependencies of the modules I depend on (but notice I still need the classes in it to be able to compile), adding Guava to my first-level dependencies, then trying to make pax-exam-spi a first-level dependency with transitive = false (won't work, same problem as above).
  • same as above, but instead of doing transitive = false, trying to use artifact-only notation, like this:

    compile "org.ops4j.pax.exam:pax-exam-spi:${PAX_EXAM_VERSION}@jar"

I know the root of the problem is that the guava version is not declared in the pax-exam-spi pom, but in its parent exam, which only declares the Guava version(s) to use in 2 different profiles' dependencyManagement sessions (this works in Maven because one of the profiles is activated if the property glassfish.release is NOT set, and the other if that property IS set). However, knowing this has not been useful so far :(

Please let me know if there's any not-so-hacky way to make sure Gradle does include the pax-exam-spi's jar in my classpath, but does not even try to parse its POM (in particular, referring to a hard-coded path to the jar is out of question!).

Renato
  • 12,940
  • 3
  • 54
  • 85
  • I don't think there is a way to prevent the parsing from happening, but the parsing has recently been improved. I recommend to try with latest 1.12 nightly (easy to apply via Gradle Wrapper). An alternative is to publish `pax-exam-spi` with a "fixed" POM to your enterprise repository. – Peter Niederwieser Apr 09 '14 at 21:01
  • What exact version number do I need? 1.12 is not working: java.io.FileNotFoundException: http://downloads.gradle.org/distributions/gradle-1.12-bin.zip – Renato Apr 09 '14 at 21:21
  • Here is how to configure wrapper for nigthly build: http://www.gradle.org/nightly and here You can find list of nightly builds: http://services.gradle.org/distributions-snapshots/ – Opal Apr 10 '14 at 05:45
  • Thanks for the directions, but with the latest 1.12 build, I am getting another error: http://pastebin.com/Zjqb3EJF – Renato Apr 10 '14 at 18:46

0 Answers0