> -----Original Message----- > From: Brett Porter [mailto:[EMAIL PROTECTED] > Sent: Friday, July 15, 2005 11:55 PM > To: Maven Users List > Subject: Re: [M2] Manifest.mf > > I'd be interested to see what you are doing here, and whether > an osgi-bundle plugin could be created to assist in this. >
Sure... Here's an example of my Ant JAR target: <target name="jar" depends="compile"> <jar manifest="${src.dir}/tutorial/example2/manifest.mf" jarfile="${bundle.dir}/${bundle.name}.jar" basedir="${output.dir}"> <include name="**"/> </jar> </target> Basically, I've got a manifest.mf file in the source tree of my osgi bundle, which happens to look something like this: Bundle-Activator: tutorial.example6.Activator Import-Package: tutorial.example5.service Bundle-Name: Spell Check Client Bundle-Description: A bundle that uses the spell check service Bundle-Vendor: Some Vendor Name Bundle-Version: 1.0.0 The Ant task *merges* my custom manifest with some tool generated manifest entries and produces a manifest file in the jar's /meta-inf directory that looks like this: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.6.1 Created-By: 1.5.0_03-b07 (Sun Microsystems Inc.) Bundle-Activator: tutorial.example2.Activator Export-Package: tutorial.example2.service Bundle-Name: English Dictionary Bundle-Description: A bundle that registers an English dictionary service Bundle-Vendor: Some Vendor Name Bundle-Version: 1.0.0 > Unfortunately the JAR plugin documentation does not yet go > deep enough into the manifest element, but it's fields are seen here: > > http://maven.apache.org/maven2/plugins/maven-jar-plugin/jar-mojo.html > > <archive> is: > http://svn.apache.org/repos/asf/maven/components/trunk/maven-a rchiver/src/main/java/org/apache/maven/archiver/MavenArchiveConfiguratio n.java > > <manifest> in there is: > http://svn.apache.org/repos/asf/maven/components/trunk/maven-a rchiver/src/main/java/org/apache/maven/archiver/ManifestConfiguration.ja va > > though you can add your own manifestFile instead of a > manifest element. > I'll check into these resources. Worst case, I guess I try out Maven-2's new plug-in development interface. I suppose it would be nice to just include a manifest file in the POM's <build><resources></resources></build> nodes, so that M2 would automatically include a custom manifest that I specify in the JAR just like I can tell maven to include other resources like property and XML files. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]