Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6608

Why can't project.version in pom.xml be set as a variable?

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.6.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      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:

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

        Attachments

        1. revision-test.zip
          9 kB
          Markus Meisterernst
        2. example.zip
          10 kB
          chenxiaoyong

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                chen.kline chenxiaoyong
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: