Maven
  1. Maven
  2. MNG-2742

Using a version range in a plugin dependency causes "failure to resolve artifact" error

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 2.0.4
    • Fix Version/s: None
    • Component/s: Dependencies
    • Labels:
      None
    • Environment:
      Windows XP SP2, java version "1.5.0_08"
    • Complexity:
      Intermediate
    • Number of attachments :
      2

      Description

      If I declare a dependency in a plugin using an exact version, Maven correctly resolves the artifact. If, however, I change the dependency's version to a version range, Maven no longer resolves the artifact. I'm using the very same artifact and version range in my project's dependencies and everything works ok. See my attached pom.xml file for details, in particular, the comments "<Unable to render embedded object: File (-- Using version range here ok -->" and "<) not found.-- Can't use version range here! -->".

      I am using the "major.minor.revision-buildNumber" version string syntax as described on the wiki.

      1. mvn.txt
        24 kB
        Matthew Adams
      2. pom.xml
        4 kB
        Matthew Adams

        Issue Links

          Activity

          Hide
          Conny Kreyssel added a comment -

          @all:

          This is more a generic question.

          All build system should be able to get every time the same output for the same input. In maven, your maven project (the call chain of maven plugins) should produce the same output for the same POM - today and in future. But if you be able to set a version range for maven plugins you do not know how a old build act with new plugins. Possibly you get errors if a required plugin parameter is not set and so on.

          In maven 3.0 you get a warning message if you do not have set a plugin version, in 3.1 mabe it stop building.

          Show
          Conny Kreyssel added a comment - @all: This is more a generic question. All build system should be able to get every time the same output for the same input. In maven, your maven project (the call chain of maven plugins) should produce the same output for the same POM - today and in future. But if you be able to set a version range for maven plugins you do not know how a old build act with new plugins. Possibly you get errors if a required plugin parameter is not set and so on. In maven 3.0 you get a warning message if you do not have set a plugin version, in 3.1 mabe it stop building.
          Hide
          Arnaud Heritier added a comment -

          Same thing here with Maven 3.0.3

          Show
          Arnaud Heritier added a comment - Same thing here with Maven 3.0.3
          Hide
          Markus KARG added a comment -

          I understand that for stable builds, it is necessary to give the exact versions of each plugin. But in some cases this argument is just ridiculous. For example: If I want my code to compile using Java 1.5, I just omit any configuration in the pom.xml and everything is fine. Actually I do not tell Maven 3.0.3 which plugin to use then, nor its version. But as soon as I want to tell the compiler that my code uses Java 6 syntax, I have to give the exact bug fix number (2.3.2):

          <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.3.2</version>
          <configuration>
          <source>1.6</source>
          <target>1.6</target>
          </configuration>
          </plugin>

          This is totally ridiculous as I STILL do not care about the name or version of the plugin, but NOW I must not only tell that it is named maven-compiler-plugin or that I want release 2.3 to be used, but ALSO that the exact bug fix 2.3.2 is to be used. I even more CANNOT tell the system anymore that I want to get the latest compiler plugin bug fix as now the version is fixed (this would have worked well without this config entry, as soon as I download a later Maven ZIP for example).

          So in fact, the force to write the version leads to WORSE results as one will not get the latest bug fixes then!

          So please, make "use the latest bug fix" the default and don't force people to check for later release numbers manually...! It is MORE essential to get IMPROVED plugins and LESS essential to have THE SAME each time. BTW, if that policy really leads to more unstable results, then the plugin authors have done something REALLY wrong...!

          Show
          Markus KARG added a comment - I understand that for stable builds, it is necessary to give the exact versions of each plugin. But in some cases this argument is just ridiculous. For example: If I want my code to compile using Java 1.5, I just omit any configuration in the pom.xml and everything is fine. Actually I do not tell Maven 3.0.3 which plugin to use then, nor its version. But as soon as I want to tell the compiler that my code uses Java 6 syntax, I have to give the exact bug fix number (2.3.2): <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> This is totally ridiculous as I STILL do not care about the name or version of the plugin, but NOW I must not only tell that it is named maven-compiler-plugin or that I want release 2.3 to be used, but ALSO that the exact bug fix 2.3.2 is to be used. I even more CANNOT tell the system anymore that I want to get the latest compiler plugin bug fix as now the version is fixed (this would have worked well without this config entry, as soon as I download a later Maven ZIP for example). So in fact, the force to write the version leads to WORSE results as one will not get the latest bug fixes then! So please, make "use the latest bug fix" the default and don't force people to check for later release numbers manually...! It is MORE essential to get IMPROVED plugins and LESS essential to have THE SAME each time. BTW, if that policy really leads to more unstable results, then the plugin authors have done something REALLY wrong...!
          Show
          Jason van Zyl added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014
          Hide
          Jason van Zyl added a comment -

          Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

          Show
          Jason van Zyl added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

            People

            • Assignee:
              Unassigned
              Reporter:
              Matthew Adams
            • Votes:
              17 Vote for this issue
              Watchers:
              21 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: