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

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

https://nvie.com/posts/a-successful-git-branching-model/

we need modify project.version in pom.xml when we merge source code from 
develope branch to master branch in git. it‘s troublesome!

So I expect that project.version in pom.xml can reference a property 
(build-version) in <propfiles>, and I can't set different version property 
value In different profiles 


{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}


> 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 &amp; Best Practices
>    Affects Versions: 3.6.0
>            Reporter: chenxiaoyong
>            Priority: Major
>         Attachments: example.zip, 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