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

Problem with CI friendly usage of ${..} which is already defined via property in pom file.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.1, 3.2.2, 3.2.5, 3.3.1, 3.3.3
    • 3.5.0-beta-1, 3.5.0
    • None
    • None

    Description

      I have test project where i defined the pom like this:

        <modelVersion>4.0.0</modelVersion>
      
        <groupId>com.soebes.examples.j2ee</groupId>
        <artifactId>parent</artifactId>
        <version>${revision}</version>
        <packaging>pom</packaging>
      

      If i define the revision on command line like this.

      mvn -Drevision=1.0-SNAPSHOT clean package

      everything fine...

      But now i want to make the usage a bit more convenient so i added the following to my pom:

        <properties>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
          <revision>1.0-SNAPSHOT</revision>
        </properties>
      

      to have a default for revision which works fine now...
      But if i would like to overwrite the property from command line like this:

      mvn -Drevision=1.0 clean package

      the build failes in the following location:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.5.5:single (assemblies) on project assembly: 
      Failed to create assembly: Unable to resolve dependencies for assembly 'archive': Failed to resolve dependencies for assembly: 
      Unable to get dependency information for com.soebes.examples.j2ee:service-client:jar:1.0-SNAPSHOT: 
      Failed to process POM for com.soebes.examples.j2ee:service-client:jar:1.0-SNAPSHOT: 
      Non-resolvable parent POM for com.soebes.examples.j2ee:service-client:[unknown-version]: 
      Failure to find com.soebes.examples.j2ee:parent:pom:${revision} in http://localhost:8081/nexus/content/groups/public was 
      cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or 
      updates are forced
      [ERROR] com.soebes.examples.j2ee:service-client:jar:1.0-SNAPSHOT
      

      Attachments

        1. x.diff
          4 kB
          Karl Heinz Marbaise
        2. log_mvn_clean_dependency_resolve_X.txt
          38 kB
          Setya
        3. log_mvn_clean_dependency_resolve_X_10122020_10_27.txt
          38 kB
          Setya

        Issue Links

          Activity

            People

              khmarbaise Karl Heinz Marbaise
              khmarbaise Karl Heinz Marbaise
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: