From issues-return-131577-archive-asf-public=cust-asf.ponee.io@maven.apache.org Mon Apr 16 01:09:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 656B5180648 for ; Mon, 16 Apr 2018 01:09:04 +0200 (CEST) Received: (qmail 89264 invoked by uid 500); 15 Apr 2018 23:09:03 -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 89253 invoked by uid 99); 15 Apr 2018 23:09:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Apr 2018 23:09:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id E07C618038A for ; Sun, 15 Apr 2018 23:09:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 2Takrk5mkIgj for ; Sun, 15 Apr 2018 23:09:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 217B85F503 for ; Sun, 15 Apr 2018 23:09:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 59302E0287 for ; Sun, 15 Apr 2018 23:09:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0BE982120A for ; Sun, 15 Apr 2018 23:09:00 +0000 (UTC) Date: Sun, 15 Apr 2018 23:09:00 +0000 (UTC) From: "Igor Dvorzhak (JIRA)" To: issues@maven.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MSHADE-154) Add ability for shade to find primary artifact from attached artifacts (similar to assembly-plugin) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MSHADE-154?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1643= 8867#comment-16438867 ]=20 Igor Dvorzhak commented on MSHADE-154: -------------------------------------- I found workaround, you need to=C2=A0package both=C2=A0main jar and jar wit= h classifier and then detach main jar from project after shading: {code:xml} maven-jar-plugin jar classifier-jar jar ${classifier} maven-shade-plugin . . . org.codehaus.gmaven gmaven-plugin remove-primary-artifact package execute project.getArtifact().setFile(null) {code} > Add ability for shade to find primary artifact from attached artifacts (s= imilar to assembly-plugin) > -------------------------------------------------------------------------= -------------------------- > > Key: MSHADE-154 > URL: https://issues.apache.org/jira/browse/MSHADE-154 > Project: Maven Shade Plugin > Issue Type: New Feature > Affects Versions: 2.0 > Environment: all > Reporter: Richard Sand > Priority: Major > Attachments: patch.txt, patch139and154.txt > > > When switching from assembly-plugin to shade-plugin for a given project, = I discovered that the shade plugin did not have the capability of using an = attached artifact as the primary artifact - only the project's main artifac= t was supported. > I've attached changes to add a configuration parameter "alternativeInputC= lassifier", which, when specified, tells the plugin to look for an artifact= with the specified classifier in the project attachments, and to use that = as the primary artifact. This makes shade behave similar to assembly-plugin= , and allows shade to recognize attached artifacts generated by previous pl= ugins in a maven execution. > This was a trivial change, but required modifying several other classes a= nd methods to accept the "primary" artifact as a parameter instead of a glo= bal variable. IMHO these changes are good for the plugin as a whole, as it = will allow for future flexibility and logic for determining the entrypoint = for the plugin (e.g. being able to run as a standalone goal with a specific= artifact as input). -- This message was sent by Atlassian JIRA (v7.6.3#76005)