Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Incomplete
-
Affects Version/s: 2.0.4
-
Fix Version/s: None
-
Component/s: Deployment, Inheritance and Interpolation
-
Labels:None
-
Environment:Windows XP., JDK 1.5
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?