You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by st...@bnpparibas.com on 2007/10/17 13:13:21 UTC
Filtering artifacts name in assembly
Hi all,
I've got two questions about assembly in a multi modules environment. I'm
running 2.2-beta1. I've searched the mailing-list and the website
documentation without any result.
- if I connect the "attached" goal to the "package" phase (which seems to
come up quite often in the examples), nothing is never assembled by
running package. I'm using the following configuration:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-1</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<phase>package</phase>
<goals>
<goal>attached</goal>
</goals>
</configuration>
</plugin>
btw, is running package enough? From the command line I must use : "mvn
package assembly:assembly" because as I understand a package lifecycle is
created.
But I expected "mvn package" to do it automatically using my
configuration. What am I doing wrong? (I tried install and deploy too)
- How to use custom names for the modules generated jars/artifacts in the
assembly? I'm certainly doing it all wrong regarding the maven process...
I had first used "finalName" in my submodules poms because I thought they
would be used as-is by the assembly process.
It seems not to be the case : it works for a local package with "mvn
package", but not in the assembly, which seems to create the artifacts
again with ${artifactId}-${version}.jar. Isn't it strange? I mean, the
assembly is not related to the maven repository, is it?
Anyway, I then tried to filter the filenames using the <files> tag in the
assembly:
...
<files>
<file>
<source>project_common/target/common-tools-${version}.jar</
source>
<destName>common.jar</destName>
<outputDirectory>target</outputDirectory>
</file>
which creates the correct jar name, but I'm still getting the
${artifactId}-${version}.jar one on top. Can I find the real source path
used by the assembly? Or maybe I can exclude the
${artifactId}-${version}.jar? I did not succeed to do that with:
<excludes>
<exclude>common-tools-${version}.jar</exclude>
<!-- <exclude>**/common-tools-${version}.jar</exclude>
-->
</excludes>
</binaries>
</moduleSet>
thanks for any help or hints to using maven the correct way,
--Stéphane
This message and any attachments (the "message") is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message.
BNP PARIBAS (and its subsidiaries) shall (will) not
therefore be liable for the message if modified.
---------------------------------------------
Ce message et toutes les pieces jointes (ci-apres le
"message") sont etablis a l'intention exclusive de ses
destinataires et sont confidentiels. Si vous recevez ce
message par erreur, merci de le detruire et d'en avertir
immediatement l'expediteur. Toute utilisation de ce
message non conforme a sa destination, toute diffusion
ou toute publication, totale ou partielle, est interdite, sauf
autorisation expresse. L'internet ne permettant pas
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce
message, dans l'hypothese ou il aurait ete modifie.
RE: Filtering artifacts name in assembly
Posted by Veyret Stephane <sv...@axway.com>.
Bonjour,
> - if I connect the "attached" goal to the "package" phase (which seems to come up quite often in the examples),
> nothing is never assembled by running package. I'm using the following configuration:
>
>btw, is running package enough? From the command line I must use : "mvn package assembly:assembly" because as I
> understand a package lifecycle is created.
> But I expected "mvn package" to do it automatically using my configuration. What am I doing wrong? (I tried
> install and deploy too)
If you want the same behavior, you should have the "assembly" goal in your pom file. There, it is as if you where executing the command:
mvn package assembly:attached
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org