war:manifest will generate a standalone MANIFEST.MF in
<warSourceDirectory>/META-INF. Despite the war association it does not
require a war project; you can use it anywhere (for ejb/mdb projects for
instance). Example:
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>manifest</goal>
</goals>
<inherited>true</inherited>
</execution>
</executions>
</plugin>
This will generate the manifest in WebContent/META-INF every time the
package phase is executed as part of the build. The goal probably
should move to the jar plugin.
-----Original Message-----
From: Steven Coco [mailto:
[hidden email]]
Sent: Friday, June 02, 2006 11:43 AM
To:
[hidden email]
Subject: Re: MANIFEST.MF generation outside of jar:jar plugin
Hi.
> What I'm looking for is a way to generate or manipulate the
> MANIFEST.MF such that it contains values from the POM, like version,
> etc. I can do this via the 'archive' element in the 'configuration' of
> the jar plugin, but this doesn't leave an artifact for use outside of
> the JAR, such as being used within the Eclipse IDE's PDE.
You could try using Maven's resource filtering. Place a skeleton
manifest in your resource directory. Place in that any variables you
want to reference: ${project.version} I believe is one. Then enable
filtering on your resource directory, with the proper character encoding
to be used. My thought is that Maven might filter your manifest and
deposit it into the target/classes directory.
You might also be able to do this filtering and then make some assembly
that grabs resources which you filter so that only the manifest is
included; and Maven filters and deposits the manifest in some assembly
output directory.
Not the best answers, but maybe you'll find something out.
Good luck.
Steev Coco.
---------------------------------------------------------------------
To unsubscribe, e-mail:
[hidden email]
For additional commands, e-mail:
[hidden email]
---------------------------------------------------------------------
To unsubscribe, e-mail:
[hidden email]
For additional commands, e-mail:
[hidden email]