Maven
  1. Maven
  2. MNG-2412

global variable filtering of pom.xml for parent and sub module pom.xml files is not working when deploying to a repository.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 2.0.4
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Windows XP., JDK 1.5
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      Greetings:

      I have a maven2 project with two sub modules. I run into an issue when I build and deploy a SNAPSHOT of this project and try to reference one of the modules as a dependency when I build another project.

      here is the project structure.
      project
      module1
      pom.xml
      module2
      pom.xml
      pom.xml

      The parent pom declares a global property in the properties section:
      <properties>
      <applicationVersion>1.1.2-SNAPSHOT</applicationVersion>
      </properties>

      The parent pom declares the project version in the following way:
      <version>$

      {applicationVersion}</version>

      The module poms refrence the parent pom with the parent tags:
      <parent>
      <groupId>com.gocsc</groupId>
      <artifactId>sam</artifactId>
      <version>${applicationVersion}

      </version>
      </parent>

      The module poms both declare the project version in the same way:
      <version>$

      {applicationVersion}</version>

      The project deploys the artifacts to the corporate repository without error but the generated poms for each sub module and also the parent module do not resolve the ${applicationVersion}

      in all of the locations:

      The parent pom project version remains the same in the deployed pom.
      <version>$

      {applicationVersion}</version>

      The parent tags in the sub module poms remain the same:
      <parent>
      <groupId>com.gocsc</groupId>
      <artifactId>sam</artifactId>
      <version>${applicationVersion}

      </version>
      </parent>

      The only section that gets resolved / filtered is the project version tags of the sub modules.
      <version>1.1.2-20060628.195852-10</version>

      This seems to be what is causing the problem when I use one of the sub modules as dependency in another project and try to build it. Here is the output:

      *****************************************

      [INFO] snapshot com.gocsc:sam-common:1.1.2-SNAPSHOT: checking for updates from com.gocsc
      Downloading: file:///\\gatling\maven2\repository/com/gocsc/sam/$

      {applicationVersion}/sam-${applicationVersion}

      .pom
      [WARNING] Unable to get resource from repository com.gocsc (file:///\\gatling\maven2\repository)
      Downloading: http://repo1.maven.org/maven2/com/gocsc/sam/$

      {applicationVersion}/sam-${applicationVersion}

      .pom
      [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Failed to resolve artifact.

      GroupId: com.gocsc
      ArtifactId: sam
      Version: $

      {applicationVersion}

      Reason: Unable to download the artifact from any repository

      com.gocsc:sam:pom:${applicationVersion}

      from the specified remote repositories:
      central (http://repo1.maven.org/maven2),
      com.gocsc (file:///\\gatling\maven2\repository)

      *******************************************************************

      Even if I manually modify the repository pom files to use the timstamp version of:
      <version>1.1.2-20060628.195852-10</version>
      I still get the same error above.

      Is this the expected behavior of the system? Is this a bug?

        Issue Links

          Activity

          Hide
          Dawid Kedziora added a comment -

          The same here.
          As far as I see <properties/> are not inherited, but even when I've added <buildVersion>SNAPSHOT</buildVersion> property to all poms (similiar to your $

          {applicationVersion}

          ) , I still got the same error:
          ... Unable to get resource from repository ... /my/company/$

          {buildVersion}/myproject-${buildVersion}

          .pom

          Show
          Dawid Kedziora added a comment - The same here. As far as I see <properties/> are not inherited, but even when I've added <buildVersion>SNAPSHOT</buildVersion> property to all poms (similiar to your $ {applicationVersion} ) , I still got the same error: ... Unable to get resource from repository ... /my/company/$ {buildVersion}/myproject-${buildVersion} .pom
          Hide
          Pablo García added a comment -

          I don't think the problem is <properties/> inheritance. I reproduced this bug on a Linux (Ubuntu 7.04) environment and if you do mvn help:effective-pom you'll see that properties are inherited.

          Show
          Pablo García added a comment - I don't think the problem is <properties/> inheritance. I reproduced this bug on a Linux (Ubuntu 7.04) environment and if you do mvn help:effective-pom you'll see that properties are inherited.
          Hide
          Henrik Brautaset Aronsen added a comment -

          The problem is the install plugin. It doesn't replace $applicationVersion with the real version in the pom files it installs to your maven2 repository. See MNG-3057.

          Show
          Henrik Brautaset Aronsen added a comment - The problem is the install plugin. It doesn't replace $applicationVersion with the real version in the pom files it installs to your maven2 repository. See MNG-3057 .
          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:
              Bill Brown
            • Votes:
              4 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: