我有以下代码来生成阴影罐子,我正在使用git-commit-plugin来创建git.properties并获取git.branch名称。 执行mvn package命令后,它将生成3个jar。
original-yms-hadoop-16.0.jar, yms-hadoop-16.0.jar, yms-hadoop-$ {git.branch} -shaded.jar
我需要带阴影的jar名称也应替换分支值。请帮助我解决这个问题。
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.abc.xyz</groupId>
<artifactId>yms-hadoop</artifactId>
<version>${git.branch}</version>
<packaging>jar</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
.................
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
我已经尝试过了,但是没有用 $ {project.artifactId}-$ {version}