前两天开发的时候使用maven打镜像,发现统一版本管理的{revision}在镜像调用时没有被赋值。
类似表现形式可能是:
{project_namme}:{revision} cannot be find
后来发现是缺少plugin插件导致的revision失败。
在pom.xml加上对应的plugin即可:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.1.0</version>
<configuration>
是否更新pom文件,此处还有更高级的用法
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>