Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-2787

Hudson doesn't support Maven2 dependency version ranges

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • maven-plugin
    • None
    • Platform: All, OS: All

      When setting up multiple Maven2 projects with the dependencies specified as
      version ranges, Hudson doesn't trigger downstream builds if a built version of a
      dependency matches the version range as specified in the downstream project.

      The above URL points to my mail in the Hudson users list archive. It describes
      the setup I used to detect this defect.

      From the sources: the culprit is in hudson.model.MavenModule, method
      buildDependencyGraph(DependencyGraph), line 355:

      MavenModule src = modules.get(d);

      modules is a HashMap with ModuleDependency objects as the key. All
      ModuleDependency objects in there have a normal version number since they
      represent the version information from the modules themselves.

      On the other hand, the lookup with ModuleDependency 'd' can contain a version
      range as the version string. Since the key lookup in the Hashmap works using the
      equals method of ModuleDependency, even if the range matches according the Maven
      versioning concepts, there will be no match from this lookup.

      I think the best way to solve this is to incorporate the usage of the following
      Maven2 interface and classes:

      org.apache.maven.artifact.versioning.ArtifactVersion
      org.apache.maven.artifact.versioning.DefaultArtifactVersion
      org.apache.maven.artifact.versioning.VersionRange

      The last class has the most interesting method ever:

      VersionRange.containsVersion(ArtifactVersion)

      I'll see if I can find the time to create a patch...

      Ringo

            kutzi kutzi
            ridesmet Ringo De Smet
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: