You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Berin Loritsch <bl...@d-haven.org> on 2003/09/04 22:59:13 UTC
Adding functionality to maven-jar-plugin
The attached patch to the plugin.jelly script for the maven-jar-plugin will
allow you to add arbitrary values to the manifest--complete with sections
which will make the sealing of classes/packages possible. The new values
are added like this:
maven.jar.manifest.attributes.list = GUIApp-Conf,GUIApp-Instrument,GUIApp-Log
maven.jar.manifest.attribute.GUIApp-Conf = org/d_haven/demoapp/DemoApp.xconf
maven.jar.manifest.attribute.GUIApp-Instrument =
org/d_haven/demoapp/DemoApp.instruments
maven.jar.manifest.attribute.GUIApp-Log = org/d_haven/demoapp/DemoApp.xlog
maven.jar.manifest.groups.list = DemoAppConstants,ValidateQuitApplication
maven.jar.manifest.DemoAppConstants.name=org/d_haven/demoapp/DemoAppConstants.class
maven.jar.manifest.DemoAppConstants.attributes.list=Description,Foo
maven.jar.manifest.DemoAppConstants.attribute.Description=It's ok
maven.jar.manifest.DemoAppConstants.attribute.Foo=bar
maven.jar.manifest.ValidateQuitApplication.name=org/d_haven/demoapp/screens/ValidateQuitApplication.class
maven.jar.manifest.ValidateQuitApplication.attributes.list=Description
maven.jar.manifest.ValidateQuitApplication.attribute.Description=We are rockin'
This will add to the Maven generated Manifest like this:
.... skip maven generated content ....
GUIApp-Conf: org/d_haven/demoapp/DemoApp.xconf
GUIApp-Instrument: org/d_haven/demoapp/DemoApp.instruments
GUIApp-Log: org/d_haven/demoapp/DemoApp.xlog
Name: org/d_haven/demoapp/DemoAppConstants.class
Description: It's ok
Foo: bar
Name: org/d_haven/demoapp/screens/ValidateQuitApplication.class
Description: We are rockin'
Please note that all the existing functionality has been preserved. We are
only adding the ability to add sections and attributes of our own design.
I personally don't like having to specify these things in property format,
but I don't know much about extending the POM so I can't propose a nicer
format. Anyway, this makes it easy for plugins to add new attributes, etc.