Reputation: 152
I work with Maven2. I want to know is there a way to hide the version of the jar after the build with packaging type "ear".
For example if:
I'm not using plugin, i'm just dependency: I have this pom for example:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>project</groupId>
<artifactId>project</artifactId>
<version>1</version>
<packaging>ear</packaging>
<dependencies>
<dependency>
<groupId>file</groupId>
<artifactId>file</artifactId>
<version>1</version> // just because it can't be empty
<type>jar</type>
</dependency>
</dependencies>
</project>
And I have installed the file.jar in my local repository by using mvn install:install-file
And I want to have as artifact an ear "project.ear" that contains the file.jar without the version name (not file-1.jar)!
Upvotes: 1
Views: 957
Reputation: 6453
Set the fileNameMapping property of the ear pluging:
<configuration>
<fileNameMapping>no-version</fileNameMapping>
</configuration>
this is not in the documentation, but should work.
edit: i just have a look at the source of the plugin and this is only in availible in the latest snapshot version of the ear plugin (2.5-SNAPHOT)
Upvotes: 1
Reputation: 93177
You just have to set the name with the <bundleFileName>
tag in your <***Module>
.
But I must say, I don't really see the point of having a more obscure name for an jar.
Resources :
Upvotes: 1