Uploaded image for project: 'ShrinkWrap Resolvers'
  1. ShrinkWrap Resolvers
  2. SHRINKRES-76

Version of the dependency is not found when <exclusion>s are defined

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0.0-alpha-5
    • 2.0.0-alpha-4
    • maven
    • None

      equals(Object) method for Maven dependency is considering exclusions as well.

      This effectively means that if you specify following in your pom.xml file:

      <dependency>
                      <groupId>com.google.appengine.orm</groupId>
                      <artifactId>datanucleus-appengine</artifactId>
                      <version>${version.org.datanucleus.gae}</version>
                      <exclusions>
                          <exclusion>
                              <!-- Force this just in case -->
                              <groupId>org.jboss.maven.plugins</groupId>
                              <artifactId>arquillian-transformer</artifactId>
                          </exclusion>
                      </exclusions>
                  </dependency>
      

      then following code:

      Maven.resolver().loadPomFromFile("/path/to/file").resolve("com.google.appengine.orm:datanucleus-appengine")
      

      is not able to find the version managed in pom.xml, failing with:

      Caused by: org.jboss.shrinkwrap.resolver.api.ResolutionException: Unable to get version for dependency specified by com.google.appengine.orm:datanucleus-appengine, it was not provided in <dependencyManagement> section.
      at org.jboss.shrinkwrap.resolver.impl.maven.PomEquippedResolveStageBaseImpl.resolveVersion(PomEquippedResolveStageBaseImpl.java:194)

              tair.sabirgaliev@bee.kz Tair Sabyrgaliyev (Inactive)
              kpiwko Karel Piwko
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: