Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 70C56200B4B for ; Thu, 21 Jul 2016 14:54:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6F6A9160A68; Thu, 21 Jul 2016 12:54:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9B01E160A6D for ; Thu, 21 Jul 2016 14:54:21 +0200 (CEST) Received: (qmail 88574 invoked by uid 500); 21 Jul 2016 12:54:20 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 88548 invoked by uid 99); 21 Jul 2016 12:54:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2016 12:54:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 835CA2C0D57 for ; Thu, 21 Jul 2016 12:54:20 +0000 (UTC) Date: Thu, 21 Jul 2016 12:54:20 +0000 (UTC) From: "Sebastian Geiger (JIRA)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MASSEMBLY-824) Use of appendAssemblyId and finalName can cause problems MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 21 Jul 2016 12:54:22 -0000 [ https://issues.apache.org/jira/browse/MASSEMBLY-824?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sebastian Geiger updated MASSEMBLY-824: --------------------------------------- Description: 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} false helper-${project.version} {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|http://stackoverflow.com/questions/38482839/maven-assembly-plugin-how-to-use-appendassemblyid/38484021#38484021] 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. -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 much 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 name. # Add an additional option to control if the assemblyId is appended to the local file name. 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 your time and attention. was: 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: {{ false helper-${project.version} }} 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|http://stackoverflow.com/questions/38482839/maven-assembly-plugin-how-to-use-appendassemblyid/38484021#38484021] 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. -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 much 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 name. # Add an additional option to control if the assemblyId is appended to the local file name. 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 your time and attention. > Use of appendAssemblyId and finalName can cause problems > -------------------------------------------------------- > > Key: MASSEMBLY-824 > URL: https://issues.apache.org/jira/browse/MASSEMBLY-824 > Project: Maven Assembly Plugin > Issue Type: Bug > Affects Versions: 2.6 > Reporter: Sebastian Geiger > > 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} > false > helper-${project.version} > {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|http://stackoverflow.com/questions/38482839/maven-assembly-plugin-how-to-use-appendassemblyid/38484021#38484021] 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. -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 much 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 name. > # Add an additional option to control if the assemblyId is appended to the local file name. > 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 your time and attention. -- This message was sent by Atlassian JIRA (v6.3.4#6332)