maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <>
Subject [jira] [Commented] (MASSEMBLY-824) Use of appendAssemblyId and finalName can cause problems
Date Fri, 29 Jul 2016 19:29:20 GMT


Hudson commented on MASSEMBLY-824:

FAILURE: Integrated in maven-plugins #7008 (See [])
[MASSEMBLY-824] Use of appendAssemblyId and finalName can cause problems

Updated documentation to clarify that setting 'appendAssemblyId' to 'false' also removes the
classifier and can lead to warnings about changing the file of the main project artifact.
(gboue: [])
* maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/mojos/

> Use of appendAssemblyId and finalName can cause problems
> --------------------------------------------------------
>                 Key: MASSEMBLY-824
>                 URL:
>             Project: Maven Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.6
>            Reporter: Sebastian Geiger
>            Assignee: Guillaume Boué
> I recently had a usecase where I wanted to rename an artifact locally in the target/
folder. I configured the maven-assembly-plugin with the following options:
> {code}
> <appendAssemblyId>false</appendAssemblyId>
> <finalName>helper-${project.version}</finalName>
> {code}
> As expected the resulting name was `helper-5.0.0-SNAPSHOT.jar`.
> Next when I built the project I noticed warnings about a conflict with the default artifact
for the project.
> {quote}
>     [WARNING] Configuration options: 'appendAssemblyId' is set to false, and 'classifier'
is missing. Instead of attaching the assembly file: [...]/target/helper-5.0.0-SNAPSHOT.jar,
it will become the file for main project artifact.
>     NOTE: If multiple descriptors or descriptor-formats are provided for this project,
the value of this file will be non-deterministic!
>     [WARNING] Replacing pre-existing project main-artifact file: [...]/target/my.module-5.0.0-SNAPSHOT.jar
with assembly file: [...]/target/helper-5.0.0-SNAPSHOT.jar
> {quote}
> Irritated by these warnings I asked about this on [StackOverflow|]
and received the following explanation:
> Essentially during installation the standard maven coordinates (G-A-V-C) are still used
independent of the {{finalName}} used to for the artifact, since this only affects the local
name inside the {{target}} folder. Now, when the {{appendAssemblyId}} is set to {{false}}
the classifier will be dropped not only from the local name, but also from the artifact's
name used during installation and there will be a clash with the default artifact name if
the project's packaging is set to jar.
> Currently there seem to be only two solutions:
> # Do not set the {{appendAssemblyId}} option to {{false}}, which means that the local
name used inside the target folder will still get the assemblyId appended (e.g. <finalName>-jar-with-dependencies.jar).
> # Alternatively, set the option {{attach}} to {{false}}, this will avoid the above mentioned
warning but also means that the artifact will no longer be installed.
> Of course I could just ignore he warning, but the after all the warning has a reason
and I would rather fix that then ignore the warning.
> h1. Suggested solutions:
> IMHO there are several solutions to resolve this:
> # Omit the assemblyId on the local name by default if {{finalName}} is used. Additionally
change the semantics of the {{appendAssemblyId}} option to only affect the installed artifact's
> # Add an additional option to control if the assemblyId is appended to the local file
> In any case, also if none of the suggested options are feasible I suggest to document
this better.
> * Make it clear in the {{appendAssemblyId}} option, that this affects both the local
and the installed artifact's file name. Also clarify the warning that appears when this option
is set to false. Also, maybe suggest to set {{attach}} to {{false}} if a conflict is detected?
> * Make it clear in the {{finalName}} option, that this only affects the local file name
and NOT the installed artifact's file name.
> Thank you for your time and attention.

This message was sent by Atlassian JIRA

View raw message