You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jamie Bisotti <jb...@gmail.com> on 2005/10/26 05:39:08 UTC

Re: [M2] jar plugin and the jar manifest

On 9/29/05, Erick Dovale <er...@carosys.com> wrote:
>
> Thanks a lot Sasa,
> I had that figure out after a lot of diging around. I could generate the
> manifest however, the resources folder is not added to the classpath in
> the manifest. I have stuff like spring contexts that need to be in the
> class path as well as the jars. Do you know of a way to add a folder to
> the classpath in the manifest??
>
> Thanks.
>
> Sasa.Djuric@swisscom.com wrote:
>
> >Put the following in the <build> section of your pom:
> >
> > <plugins>
> > <plugin>
> > <groupId>org.apache.maven.plugins</groupId>
> > <artifactId>maven-jar-plugin</artifactId>
> > <configuration>
> > <archive>
> > <manifest>
> > <mainClass>com.acme.MainClass</mainClass>
> > <addClasspath>true</addClasspath>
> > <addExtensions>true</addExtensions>
> > <classpathPrefix>./lib/</classpathPrefix>
> > </manifest>
> > </archive>
> > </configuration>
> > </plugin>
> > </plugins>
> >
> >the <classpathPrefix> depends where You put Your dependend jars relative
> >to the created jar file.
> >
> >
> >-----Original Message-----
> >From: Erick Dovale [mailto:erick.dovale@carosys.com]
> >Sent: Wednesday, September 28, 2005 11:34 PM
> >To: Maven Users List
> >Subject: [M2] jar plugin and the jar manifest
> >
> >Hello there,
> >I am generating my jars perfectly using maven-jar-plugin. I see it
> >actually creates a minifest file and includes it in the jar file which
> >is perfect. However, I need this jar to be executable and the plugin
> >does not add the classpath entries to the manifest. How can I have this
> >plugin to add the classpath to the manifest? I also need to add the main
> >class entry in the manifest but this one has to be specified in the pom
> >somehow.
> >Reading through the list I see there is a way to add manifest entries in
> >the configuration of the jar plugin however, I was unable to find an
> >example of a pom doing this. I am assuming it is something like this:
> >
> > <plugin>
> > <groupId>org.apache.maven.plugins</groupId>
> > <artifactId>maven-jar-plugin</artifactId>
> > <configuration>
> > <manifestEntries>
> > <manifestEntry></manifestEntry>
> > </manifestEntries>
> > </configuration>
> > </plugin>
> >
> >But then how can I speciefy the key/value pair? should I go like:
> ><manifestEntry>
> > <key>...</key>
> > <value>...</value>
> ></manifestEntry>
> >
> >If it is like this, There should be a variable somewhere that refers to
> >the runtime classpath for the project; how is it called??
> >Thanks a lot.
> >
> >edovale
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
If those files/folders are declared as resources, they should be there. If
they are not, I'd suggest you file something in JIRA.

--
Jamie Bisotti