Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-787

Dependency suggestion in current project should take precedence over transitive dependencies by default

    XMLWordPrintableJSON

Details

    Description

      The current dependency mechanism does not use the versions specified in the POM for compilation. It uses the most recent version from some transitive dependency. An example is the xml-apis. If you specifiy e.g. version 1.3.02 in your pom, version 2.0.2 is used comming from transitive dependencies.

      Another problem is, as soon as you specify ranges for the version, you get an exception:
      If you specifiy e.g. [1.3.02] or [1.3.01,1.3.02] or [1.3.02, 1.3.03] you always get the same NPE:

      java.lang.NullPointerException: version was null for xml-apis:xml-apis
      at
      org.apache.maven.artifact.DefaultArtifact.getBaseVersion(DefaultArtifact.java:295)
      at
      org.apache.maven.artifact.DefaultArtifact.getId(DefaultArtifact.java:202)
      at
      org.apache.maven.artifact.resolver.DebugResolutionListener.includeArtifact(DebugResolutionListener.java:56)
      at
      org.apache.maven.artifact.resolver.DefaultArtifactCollector.fireEvent(DefaultArtifactCollector.java:275)
      at
      org.apache.maven.artifact.resolver.DefaultArtifactCollector.fireEvent(DefaultArtifactCollector.java:254)
      at
      org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:166)
      at
      org.apache.maven.artifact.resolver.DefaultArtifactCollector.recurse(DefaultArtifactCollector.java:204)
      at
      org.apache.maven.artifact.resolver.DefaultArtifactCollector.collect(DefaultArtifactCollector.java:70)
      at
      org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTra

      Attachments

        Issue Links

          Activity

            People

              brett Brett Porter
              cziegeler Carsten Ziegeler
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 2h
                  2h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified