How to override maven property in command line?

后端 未结 1 1511
灰色年华
灰色年华 2020-11-28 09:09

I have the following plain pom running by Maven 3.0.4.




        
相关标签:
1条回答
  • 2020-11-28 09:27

    See Introduction to the POM

    finalName is created as:

    <build>
        <finalName>${project.artifactId}-${project.version}</finalName>
    </build>
    

    One of the solutions is to add own property:

    <properties>
        <finalName>${project.artifactId}-${project.version}</finalName>
    </properties>
    <build>
        <finalName>${finalName}</finalName>
     </build>
    

    And now try:

    mvn -DfinalName=build clean package

    0 讨论(0)
提交回复
热议问题