Loading

Controlling final JAR file name when using Maven deployment pipeline

Дата публикации: Aug 6, 2025
Действия

DESCRIPTION

Changing the final name of the JAR being generated, by default this would be generated according to the following pattern:
artifactId+version+packaging.JAR
for example with the following details set in the pom:
<groupId>com.mycompany</groupId>
<artifactId>testing-output-name</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>mule-application</packaging>
This would output a file named:
testing-output-name-1.0.0-SNAPSHOT-mule-application.jar
But you wish to generate the file with a different or custom name.

STEPS TO FOLLOW

You can leverage the <finalName> property within the <build> section of the POM, do bear in mind that the "packaging" will still be amended to the final JAR name generated, for example:
<build>
		<finalName>custom-final-name</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<version>3.0.0</version>
			</plugin>
			<plugin>
				<groupId>org.mule.tools.maven</groupId>
				<artifactId>mule-maven-plugin</artifactId>
				<version>${mule.maven.plugin.version}</version>
				<extensions>true</extensions>
...
This would generate a JAR file with the following name:
custom-final-name-mule-application.jar
You can also configure this with property placeholder values as needed:
<finalName>${artifactId}-${version}-${environment}</finalName>




 

 

Номер статьи базы знаний

001115219

 
Загрузка
Salesforce Help | Article