You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Michael Heuer (JIRA)" <ji...@codehaus.org> on 2005/10/31 17:52:45 UTC

[jira] Updated: (MNG-1380) assembly jar-with-dependencies does not utilize or provide for manifest configuration

     [ http://jira.codehaus.org/browse/MNG-1380?page=all ]

Michael Heuer updated MNG-1380:
-------------------------------

    Attachment: mng-1380-src.tar.gz

In the attached example, Main-Class manifest configuration information is added to the pom.xml for the jar plugin:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
	  <archive>
	    <manifest>
	      <mainClass>org.apache.maven.plugins.App</mainClass>
	    </manifest>
	  </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

such that the manifest for the jar created in
$ mvn package

contains

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: heuer
Build-Jdk: 1.5.0_05
Extension-Name: mng-1380
Implementation-Title: mng-1380
Implementation-Version: 1.0-SNAPSHOT
Main-Class: org.apache.maven.plugins.App

and runs

$ java -jar target/mng-1380-1.0-SNAPSHOT.jar 
MNG-1380


The jar created with
$ mvn assembly:assembly -DdescriptorId=jar-with-dependencies

does not contain the Main-Class attribute

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: 1.5.0_05-44 ("Apple Computer, Inc.")

and as such does not run

$ java -jar target/mng-1380-1.0-SNAPSHOT-jar-with-dependencies.jar 
Failed to load Main-Class manifest attribute from
target/mng-1380-1.0-SNAPSHOT-jar-with-dependencies.jar

It would be desireable if the maven-assembly-plugin was able to re-use the manifest configuration information provided for the maven-jar-plugin or was to provide similar manifest configuration options itself.

> assembly jar-with-dependencies does not utilize or provide for manifest configuration
> -------------------------------------------------------------------------------------
>
>          Key: MNG-1380
>          URL: http://jira.codehaus.org/browse/MNG-1380
>      Project: Maven 2
>         Type: Bug
>   Components: maven-assembly-plugin
>     Versions: 2.0
>  Environment: $ uname -a
> Darwin xxx 8.2.0 Darwin Kernel Version 8.2.0: Fri Jun 24 17:46:54 PDT 2005; root:xnu-792.2.4.obj~3/RELEASE_PPC Power Macintosh powerpc
> $ java -version
> java version "1.5.0_05"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-72)
> Java HotSpot(TM) Client VM (build 1.5.0_05-44, mixed mode, sharing)
> $ mvn -version
> Maven version: 2.0
> maven-assembly-plugin version 2.0
>     Reporter: Michael Heuer
>     Priority: Minor
>  Attachments: mng-1380-src.tar.gz
>
>
> Date: Mon, 31 Oct 2005 17:04:21 +1100
> From: Brett Porter <br...@gmail.com>
> To: Maven Users List <us...@maven.apache.org>
> Subject: Re: [m2] manifest for assembly jar-with-dependencies
> Yes, that's an issue with the assembly plugin. If there is no
> corresponding JIRA issue, please file one.
> - Brett
> On 10/28/05, Michael Heuer <he...@acm.org> wrote:
> > Hello,
> >
> > I followed the guide at
> >
> > > http://maven.apache.org/guides/mini/guide-manifest.html
> >
> > to add entries to my MANIFEST.MF, and that works fine with
> >
> > $ mvn package
> >
> > However, it seems that the assembly plugin does not reuse the
> > configuration information when building the jar-with-dependencies jar, so
> > I'm left with a default manifest in that jar.
> >
> >    michael

-- 
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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org