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

chenxiaoyong commented on MNG-6608:
-----------------------------------

${revision} can't solve my trouble, 
any variable in pom.xml will NOT be replaced in compile-time or build-time, 
the proect.verion in pom.xml outputed into the maven 
repository(~/.m2/repository/....)  is yet '${revision}',
it will NOT be replaced by a actual version( 0.0.1-SNAPSHOT)

${revision} 不能解决我的问题,
在编译期或者build期,在pom.xml文件中的任何变量都不会被替换, 被输出到Maven仓库中pom.xml文件,proect.verion 
仍然是'${revision}', 它不会被替换成实际的版本号(比如 0.0.1-SNAPSHOT )

最关键的问题就是: maven 插件设计为 proect.verion 不支持变量,我感觉这是一个设计缺陷



> Why can't project.version in pom.xml be set as a variable?
> ----------------------------------------------------------
>
>                 Key: MNG-6608
>                 URL: https://issues.apache.org/jira/browse/MNG-6608
>             Project: Maven
>          Issue Type: New Feature
>          Components: Design, Patterns & Best Practices
>    Affects Versions: 3.6.0
>            Reporter: chenxiaoyong
>            Priority: Major
>         Attachments: revision-test.zip
>
>
> we need modify project.version in pom.xml  when we merge source code from 
> develope branch to master branch in git. it‘s troublesome!
> Why can't project.version in pom.xml be set as a variable?
> for example:
> {code:xml}
> <project ... >
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>org.example</groupId>
>     <artifactId>example</artifactId>
>     <version>${project-version}</version>
>     <packaging>jar</packaging>
>     <properties>
>         <project-version>1.0.0-SNAPSHOT</project-version>
>     </properties>
>     <profiles>
>         <profile>
>             <!-- snapshot -->
>             <id>dev</id>
>             <properties>
>                 <profiles.active>dev</profiles.active>
>                 <project-version>1.0.0-SNAPSHOT</project-version>
>             </properties>
>             <activation>
>                 <activeByDefault>true</activeByDefault>
>             </activation>
>         </profile>
>         <profile>
>             <!-- RELEASE -->
>             <id>release</id>
>             <properties>
>                 <profiles.active>release</profiles.active>
>                 <project-version>1.0.0-RELEASE</project-version>
>             </properties>
>         </profile>
>     </profiles>
>   
> </project>
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to