Vyacheslav
Vyacheslav

Reputation: 3244

eclipse maven filename specification

How to configure maven build in eclipse to use another filename?

Analog of:

mvn -f custom_pom_name.pom


mvn --help
...
-f,--file                              Force the use of an alternate POM
                                   file.
...

Upvotes: 3

Views: 1055

Answers (3)

Premraj
Premraj

Reputation: 74671

set the finalName property in pom.xml as follows:

 <build>
   <finalName>myjar</finalName>
 </build>

From commandline: We cannot directly override fileName. Adding the following property in pom, we can do as follows:

<myCustomName>${artifactId}-${version}</myCustomName>
....
<build>
<finalName>${myCustomName}</finalName>
...
</build>

from commandline, we can define as follows:

-DmyCustomName=%maven.project.artifcatId%-%build.number%

Upvotes: 0

alexxismachine
alexxismachine

Reputation: 56

Add -f custom_pom_name.pom to the Goals: section in the run configuration dialog.

Upvotes: 4

Kai
Kai

Reputation: 39651

Choose Run As -> Maven build.... In the dialog add f as parameter with the pom-File as value.

... or consider using profiles instead of different pom-files.

Upvotes: 0

Related Questions