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

Problem parsing version ranges

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.6, 2.0.7, 2.0.8, 2.0.9
    • 3.0-alpha-1
    • None
    • Linux FC6/ jdk 1.6.0

    Description

      My pom includes the following dependency:

      <dependency>
        <groupId>it.unimaticaspa.unique</groupId>
        <artifactId>unilet-core</artifactId>
        <version>[5.0.9.0,5.0.10.0)</version>
        <type>jar</type>
      </dependency>

      When i try to build the project i get the following stacktrace:

      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Unable to parse version '[5.0.9.0,5.0.10.0)' for dependency 'it.unimaticaspa.unique:unilet-core:jar': Range defies version ordering: [5.0.9.0,5.0.10.0)
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      org.apache.maven.lifecycle.LifecycleExecutionException: Unable to parse version '[5.0.9.0,5.0.10.0)' for dependency 'it.unimaticaspa.unique:unilet-core:jar': Range defies version ordering: [5.0.9.0,5.0.10.0)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:552)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
              at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
              at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
              at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.project.artifact.InvalidDependencyVersionException: Unable to parse version '[5.0.9.0,5.0.10.0)' for dependency 'it.unimaticaspa.unique:unilet-core:jar': Range defies version ordering: [5.0.9.0,5.0.10.0)
              at org.apache.maven.project.artifact.MavenMetadataSource.createArtifacts(MavenMetadataSource.java:331)
              at org.apache.maven.project.MavenProject.createArtifacts(MavenProject.java:1558)
              at org.apache.maven.plugin.DefaultPluginManager.resolveTransitiveDependencies(DefaultPluginManager.java:1236)
              at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:397)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
              ... 16 more
      Caused by: org.apache.maven.artifact.versioning.InvalidVersionSpecificationException: Range defies version ordering: [5.0.9.0,5.0.10.0)
              at org.apache.maven.artifact.versioning.VersionRange.parseRestriction(VersionRange.java:210)
              at org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec(VersionRange.java:125)
              at org.apache.maven.project.artifact.MavenMetadataSource.createArtifacts(MavenMetadataSource.java:327)
              ... 20 more

      It seems that versions are compared as strings, because the problem only comes out comparing versions with different numbers of digits (such as 5.0.9.0 and 5.0.10.0). While comparing 5.0.8.0 with 5.0.9.0 everything is fine.

      Attachments

        Issue Links

          Activity

            People

              hboutemy Herve Boutemy
              gcontini Gabriele Contini
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: