Uploaded image for project: 'ShrinkWrap Resolvers'
  1. ShrinkWrap Resolvers

ShrinkWrap fails to resolve artifact co-ordinate with version implicit from loaded pom


    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Out of Date
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-alpha-1
    • Component/s: None
    • Environment:


      ShrinkWrap's Maven Dependency Resolver doesn't successfully resolve artifacts that're specified with an implicit version in their co-ordinates, even if that version can be determined from a loaded pom.xml . This forces duplication of version listings between tests and the project pom, leading to greater maintenance burden and the increased probability of tests not reflecting the real code that gets run.

      Tested with "org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven:jar:1.0.0-beta-6" as depended on by Arquillian 1.0.0.Final via "org.jboss.shrinkwrap:shrinkwrap-impl-base:jar:1.0.0". Re-tested with resolver 2.0.0-alpha-1, issue remains.


      MavenDependencyResolver resolver = DependencyResolvers.use(MavenDependencyResolver.class)
      WebArchive war = ShrinkWrap.create(WebArchive.class, "demo.war")

      should, if some-group:some-artifact is defined in pom.xml via a direct dependency, dependencyManagement section, parent pom, or a <type>import</type> pom in dependencyManagement, then it should be able to figure out the version without it being specified, eg:

      WebArchive war = ShrinkWrap.create(WebArchive.class, "demo.war")

      ... or even better, the artifact should be resolved from a class reference by looking up the artifact, so you can write something like the imaginary:

      WebArchive war = ShrinkWrap.create(WebArchive.class, "demo.war")

      as suggested in https://issues.jboss.org/browse/ARQ-412 . This can't wholly replace specification by artifact co-ordinates, as not all artifacts necessarily contain Java classes, and it may also be desirable to bundle artifacts that aren't in <test/> scope so their classes can't be referenced directly in the tests.

      Note that importing dependencies from the target's pom wholesale succeeds, but offers no control over which dependencies are pulled in so you can't test with a subset, a particular profile, etc.


      Possibly related to https://issues.jboss.org/browse/ARQ-412

        Gliffy Diagrams




              • Assignee:
                kpiwko Karel Piwko
                ringerc Craig Ringer
              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created: