【问题标题】:replace version in maven替换 Maven 中的版本
【发布时间】:2020-09-17 20:44:41
【问题描述】:

我的 pom.xml 中有这段代码:

<build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <configuration>
                        <descriptors>
                            <descriptor>assembly.xml</descriptor>
                        </descriptors>
                        <appendAssemblyId>false</appendAssemblyId>
                        <finalName>bonanza-{version}</finalName>
                    </configuration>
                    <executions>
                        <execution>
                            <id>make-assembly</id>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

但 {version} 不会被替换为项目的版本

 <groupId>com.bonanza</groupId>
    <artifactId>bonanza-lines</artifactId>
    <version>2.0.0</version>

【问题讨论】:

    标签: maven maven-2 maven-3 maven-plugin


    【解决方案1】:

    我觉得应该是${project.version}

    【讨论】:

      猜你喜欢
      • 2016-08-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-22
      • 1970-01-01
      • 2019-06-05
      • 2019-02-23
      • 1970-01-01
      相关资源
      最近更新 更多