Maven2: Renaming provided dependecies at package phase?
Greetings
I have an ear artifact with a finalName tag in its build definition in the POM.
<artifactId>application-app</artifactId>
...
<build>
<finalName>application</finalName>
This results in me getting the 开发者_运维技巧artifact application-app as the file application.ear when building. It is important that the ear file is named like this due to some heavy legacy integration with other solutions.
The problem is that we have several specific build projects, which all include this ear as a provided dependency. Since the actual artifact name is application-app it comes out as application-app.ear -> runtime crash.
Changing the artifact ID from application-app to application is not an option.
Do you know of a way to implement a finalName like operation on provided dependecies (I guess in the package phase...)?
Try configuring the Maven EAR plugin:
<project>
...
<build>
...
<plugins>
...
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.4</version>
<configuration>
<finalName>application</finalName>
</configuration>
</plugin>
...
</project>
精彩评论