You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benson Margulies (JIRA)" <ji...@codehaus.org> on 2009/07/15 21:34:22 UTC

[jira] Created: (MSHADE-52) non-attached shade in pom package fails

non-attached shade in pom package fails
---------------------------------------

                 Key: MSHADE-52
                 URL: http://jira.codehaus.org/browse/MSHADE-52
             Project: Maven 2.x Shade Plugin
          Issue Type: Bug
    Affects Versions: 1.2.1
            Reporter: Benson Margulies



I have a project with POM packaging. It's purpose is to run the assembly plugin to prepare releases. I don't want any artifacts except the POM, since the resulting release is a zip file that isn't a maven artifact.

As part of the process, I configure shade to mush together various other artifacts into a big jar that goes into the releases. So, I specified finalName and turned off attachment, and I am rewarded with the following. Note that i do have the right phase and goal.



INFO] Unpacking /Users/benson/.m2/repository/com/basistech/rlpj/dictionaries/0.8-SNAPSHOT/dictionaries-0.8-SNAPSHOT.jarto
 /Users/benson/x/trunk/greenhouse/etrog/distribution/target/dicts
with Includes null and excludes:null
[INFO] [site:attach-descriptor]
[INFO] [shade:shade {execution: default}]
[ERROR] The project main artifact does not exist. This could have the following
[ERROR] reasons:
[ERROR] - You have invoked the goal directly from the command line. This is not
[ERROR]   supported. Please add the goal to the default lifecycle via an
[ERROR]   <execution> element in your POM and use "mvn package" to have it run.
[ERROR] - You have bound the goal to a lifecycle phase before "package". Please
[ERROR]   remove this binding from your POM such that the goal will be run in
[ERROR]   the proper phase.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MSHADE-52) non-attached shade in pom package fails

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSHADE-52?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MSHADE-52.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3
         Assignee: Benjamin Bentmann

Fixed in [r894704|http://svn.apache.org/viewvc?view=revision&revision=894704].

@Benson:
The next plugin version will exclude the project main artifact if it is of type "pom" just like the plugin already does for the dependencies. Furthermore, a new parameter {{outputFile}} has been added to simply save the shaded artifact somewhere rather than attaching it or replacing the main artifact.

@Larry:
You seem to describe a different use case than Benson. The general way to define plugin configuration/executions to be inherited by child modules is to declare the plugin inside the {{<pluginManagement>}} section of the parent POM and to use
{code:xml}
<build>
  <plugins>
    <plugin>
      <artifactId>maven-shade-plugin</artifactId>
    </plugin>
  </plugins>
</buiild>
{code}
inside the child modules that want to actually use/run the plugin as defined by the parent.

> non-attached shade in pom package fails
> ---------------------------------------
>
>                 Key: MSHADE-52
>                 URL: http://jira.codehaus.org/browse/MSHADE-52
>             Project: Maven 2.x Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Benson Margulies
>            Assignee: Benjamin Bentmann
>             Fix For: 1.3
>
>         Attachments: MSHADE-52.patch, MSHADE-52.patch
>
>
> I have a project with POM packaging. It's purpose is to run the assembly plugin to prepare releases. I don't want any artifacts except the POM, since the resulting release is a zip file that isn't a maven artifact.
> As part of the process, I configure shade to mush together various other artifacts into a big jar that goes into the releases. So, I specified finalName and turned off attachment, and I am rewarded with the following. Note that i do have the right phase and goal.
> INFO] Unpacking /Users/benson/.m2/repository/com/basistech/rlpj/dictionaries/0.8-SNAPSHOT/dictionaries-0.8-SNAPSHOT.jarto
>  /Users/benson/x/trunk/greenhouse/etrog/distribution/target/dicts
> with Includes null and excludes:null
> [INFO] [site:attach-descriptor]
> [INFO] [shade:shade {execution: default}]
> [ERROR] The project main artifact does not exist. This could have the following
> [ERROR] reasons:
> [ERROR] - You have invoked the goal directly from the command line. This is not
> [ERROR]   supported. Please add the goal to the default lifecycle via an
> [ERROR]   <execution> element in your POM and use "mvn package" to have it run.
> [ERROR] - You have bound the goal to a lifecycle phase before "package". Please
> [ERROR]   remove this binding from your POM such that the goal will be run in
> [ERROR]   the proper phase.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MSHADE-52) non-attached shade in pom package fails

Posted by "Larry Shatzer (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSHADE-52?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Larry Shatzer updated MSHADE-52:
--------------------------------

    Attachment: MSHADE-52.patch

Ignore last patch. I was originally trying to put a test under the regular tests, but could not find a quick way to add this test.

This new patch has it under the IT tests

> non-attached shade in pom package fails
> ---------------------------------------
>
>                 Key: MSHADE-52
>                 URL: http://jira.codehaus.org/browse/MSHADE-52
>             Project: Maven 2.x Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Benson Margulies
>         Attachments: MSHADE-52.patch, MSHADE-52.patch
>
>
> I have a project with POM packaging. It's purpose is to run the assembly plugin to prepare releases. I don't want any artifacts except the POM, since the resulting release is a zip file that isn't a maven artifact.
> As part of the process, I configure shade to mush together various other artifacts into a big jar that goes into the releases. So, I specified finalName and turned off attachment, and I am rewarded with the following. Note that i do have the right phase and goal.
> INFO] Unpacking /Users/benson/.m2/repository/com/basistech/rlpj/dictionaries/0.8-SNAPSHOT/dictionaries-0.8-SNAPSHOT.jarto
>  /Users/benson/x/trunk/greenhouse/etrog/distribution/target/dicts
> with Includes null and excludes:null
> [INFO] [site:attach-descriptor]
> [INFO] [shade:shade {execution: default}]
> [ERROR] The project main artifact does not exist. This could have the following
> [ERROR] reasons:
> [ERROR] - You have invoked the goal directly from the command line. This is not
> [ERROR]   supported. Please add the goal to the default lifecycle via an
> [ERROR]   <execution> element in your POM and use "mvn package" to have it run.
> [ERROR] - You have bound the goal to a lifecycle phase before "package". Please
> [ERROR]   remove this binding from your POM such that the goal will be run in
> [ERROR]   the proper phase.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MSHADE-52) non-attached shade in pom package fails

Posted by "Larry Shatzer (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSHADE-52?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Larry Shatzer updated MSHADE-52:
--------------------------------

    Attachment: MSHADE-52.patch

Here is a patch to solve this issue. I was having the same issue with a "parent pom" for shaded "uber jars".

I just put an if statement around 2 sections of code that if the packaging type was pom, to skip those sections.

> non-attached shade in pom package fails
> ---------------------------------------
>
>                 Key: MSHADE-52
>                 URL: http://jira.codehaus.org/browse/MSHADE-52
>             Project: Maven 2.x Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Benson Margulies
>         Attachments: MSHADE-52.patch
>
>
> I have a project with POM packaging. It's purpose is to run the assembly plugin to prepare releases. I don't want any artifacts except the POM, since the resulting release is a zip file that isn't a maven artifact.
> As part of the process, I configure shade to mush together various other artifacts into a big jar that goes into the releases. So, I specified finalName and turned off attachment, and I am rewarded with the following. Note that i do have the right phase and goal.
> INFO] Unpacking /Users/benson/.m2/repository/com/basistech/rlpj/dictionaries/0.8-SNAPSHOT/dictionaries-0.8-SNAPSHOT.jarto
>  /Users/benson/x/trunk/greenhouse/etrog/distribution/target/dicts
> with Includes null and excludes:null
> [INFO] [site:attach-descriptor]
> [INFO] [shade:shade {execution: default}]
> [ERROR] The project main artifact does not exist. This could have the following
> [ERROR] reasons:
> [ERROR] - You have invoked the goal directly from the command line. This is not
> [ERROR]   supported. Please add the goal to the default lifecycle via an
> [ERROR]   <execution> element in your POM and use "mvn package" to have it run.
> [ERROR] - You have bound the goal to a lifecycle phase before "package". Please
> [ERROR]   remove this binding from your POM such that the goal will be run in
> [ERROR]   the proper phase.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (MSHADE-52) non-attached shade in pom package fails

Posted by "Larry Shatzer (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSHADE-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=198266#action_198266 ] 

Larry Shatzer edited comment on MSHADE-52 at 11/13/09 3:09 PM:
---------------------------------------------------------------

Here is a patch to solve this issue. I was having the same issue with a "parent pom" for shaded "uber jars".

I just put an if statement around 2 sections of code that if the packaging type was pom, to skip those sections.

The patch also puts a test into the integration tests (not sure if this is the right spot, but was easy to add here)

      was (Author: larrys):
    Here is a patch to solve this issue. I was having the same issue with a "parent pom" for shaded "uber jars".

I just put an if statement around 2 sections of code that if the packaging type was pom, to skip those sections.
  
> non-attached shade in pom package fails
> ---------------------------------------
>
>                 Key: MSHADE-52
>                 URL: http://jira.codehaus.org/browse/MSHADE-52
>             Project: Maven 2.x Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Benson Margulies
>         Attachments: MSHADE-52.patch
>
>
> I have a project with POM packaging. It's purpose is to run the assembly plugin to prepare releases. I don't want any artifacts except the POM, since the resulting release is a zip file that isn't a maven artifact.
> As part of the process, I configure shade to mush together various other artifacts into a big jar that goes into the releases. So, I specified finalName and turned off attachment, and I am rewarded with the following. Note that i do have the right phase and goal.
> INFO] Unpacking /Users/benson/.m2/repository/com/basistech/rlpj/dictionaries/0.8-SNAPSHOT/dictionaries-0.8-SNAPSHOT.jarto
>  /Users/benson/x/trunk/greenhouse/etrog/distribution/target/dicts
> with Includes null and excludes:null
> [INFO] [site:attach-descriptor]
> [INFO] [shade:shade {execution: default}]
> [ERROR] The project main artifact does not exist. This could have the following
> [ERROR] reasons:
> [ERROR] - You have invoked the goal directly from the command line. This is not
> [ERROR]   supported. Please add the goal to the default lifecycle via an
> [ERROR]   <execution> element in your POM and use "mvn package" to have it run.
> [ERROR] - You have bound the goal to a lifecycle phase before "package". Please
> [ERROR]   remove this binding from your POM such that the goal will be run in
> [ERROR]   the proper phase.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira