tags:

views:

55

answers:

2

I'm using maven to build a ".ear" project that resolves dependencies from a maven repository, and then packages them into an ear (that's probably a redundant sentence...).

When the dependencies show up in the ear file, they're named according to this format:

<artifactId>-<version>.<type>

I'd like them to be named:

<artifactId>.<type>

Can someone point me in the right direction?

A: 

Set the finalName property. See http://maven.apache.org/plugins/maven-assembly-plugin/assembly-mojo.html for more details

Rob Di Marco
This lets me change the name of the final ear file output (which is nice and all,) but what I really want to do is change the name of the dependencies that are inside the ear file, not the ear file itself. (or am I misunderstanding?)
Jared
+3  A: 

If you're using the maven-assembly-plugin to build your ear, you can use the outputFileNameMapping property in your descriptor: http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html#class_dependencySet

However, you're probably better off using the maven-ear-plugin, in which case you can customize the bundleFileName, as described here.

saleemshafi
The maven-ear-plugin requires that I add a bundleFileName for each and every dependent, correct? (I can't specify a pattern that should apply to all of them unless I use maven-assembly-plugin).
Jared
yep, that's my understanding. Although, with the ear plugin, you're technically specifying the modules that you're adding to the ear, not dependencies.
saleemshafi