[ 
https://issues.apache.org/jira/browse/MINSTALL-15?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17965922#comment-17965922
 ] 

Olivier Lamy commented on MINSTALL-15:
--------------------------------------

This project has moved from Jira to GitHub Issues. This issue was migrated to 
[apache/maven-install-plugin#201|https://github.com/apache/maven-install-plugin/issues/201].
 

> Use ${variables} in dependencies doesn't work when pom is installed in the 
> local repository
> -------------------------------------------------------------------------------------------
>
>                 Key: MINSTALL-15
>                 URL: https://issues.apache.org/jira/browse/MINSTALL-15
>             Project: Maven Install Plugin (Moved to GitHub Issues)
>          Issue Type: Bug
>         Environment: maven-install-plugin 2.1
>            Reporter: Jean-Michel TourniƩ
>            Assignee: Brett Porter
>            Priority: Major
>         Attachments: MyProject.zip
>
>
> I have a pom, which use variables :
>       - myproject.ver  : the current version of the project
>       - commons-io.ver : the version of commons-io, used by the project
> I define a profile file :
> {code:xml} 
> <properties>
>       <myproject.ver>12.12</myproject.ver>
>       <commons-io.ver>1.0</commons-io.ver>
> </properties>
> {code} 
>     
> This is my pom:
> {code:xml} 
> <project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>test</groupId>
>   <artifactId>MyProject</artifactId>
>   <packaging>jar</packaging>
>   <version>${myproject.ver}</version>
>   <name>MyProject</name>
>   <dependencies>
>       <!-- commons-io -->
>     <dependency>
>       <groupId>commons-io</groupId>
>       <artifactId>commons-io</artifactId>
>       <version>${commons-io.ver}</version>
>       <type>jar</type>
>       <scope>compile</scope>
>     </dependency>
>   </dependencies>
>   
> </project>
> {code} 
> When I buil my project by mvn install, I have in my target directory, the 
> file exported-pom.xml, where variable are expanded :
> {code:xml} 
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>test</groupId>
>   <artifactId>MyProject</artifactId>
>   <name>MyProject</name>
>   <version>12.12</version>
>   <dependencies>
>     <dependency>
>       <groupId>commons-io</groupId>
>       <artifactId>commons-io</artifactId>
>       <version>1.0</version>
>       <scope>compile</scope>
>     </dependency>
>   </dependencies>
>   <properties>
>     <commons-io.ver>1.0</commons-io.ver>
>     <myproject.ver>12.12</myproject.ver>
>   </properties>
> </project>
> {code} 
> But in my repository, the file MyProject-12.12.pom, contain 
> *$\{commons-io.ver\}* instead of '1.0'. 
> {code:xml} 
> <?xml version="1.0"?>
> <project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>test</groupId>
>   <artifactId>MyProject</artifactId>
>   <name>MyProject</name>
>   <version>12.12</version>
>   <dependencies>
>     <dependency>
>       <groupId>commons-io</groupId>
>       <artifactId>commons-io</artifactId>
>       <version>${commons-io.ver}</version>
>       <scope>compile</scope>
>     </dependency>
>   </dependencies>
>   <distributionManagement>
>     <status>deployed</status>
>   </distributionManagement>
> </project>
> {code} 
> When I use my project as a dependencie of another projet, mvn attempt to 
> download artifact :
> {code}
> http://repo1.maven.org/maven2/commons-io/commons-io/${commons-io.ver\}/commons-io-$\{commons-io.ver\}.pom
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to