I have a project, which is built using Maven assembly plugin.
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
I have a file BUILD.txt
, which contains the current build number.
When I call mvn assembly:single
, I want maven-assembly-plugin
to generate a JAR file (with all dependencies) called myproduct-1.0-SNAPSHOT.BUILD.jar
, where BUILD is the text from BUILD.txt
(i. e. if BUILD.txt
contains 172, the result JAR should be called myproduct-1.0-SNAPSHOT.172.jar
).
How can I read the text from BUILD.txt
such that I can use it in the finalName
setting of the assembly plugin?
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>${project.build.finalName}.${build}.jar</finalName
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
BUILD.txt
to contain buildNumber=NNN
${buildNumber}
for <finalName>
BUILD.txt
anymore${buildNumber}
for <finalName>