wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes maven3 - adding a line to manifest.mf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "maven3 - adding a line to manifest.mf " Watch "maven3 - adding a line to manifest.mf " New topic
Author

maven3 - adding a line to manifest.mf

olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
hi,

i would like to add a line to my .jar that gets created:


but i get:
Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2:single (create-executable-jar) on project SoundBox-PlayerEngine: Unable to parse configuration of mojo org.apache.maven.plugins:maven-assembly-plugin:2.2:single for parameter manifest: Cannot find setter, adder nor field in org.apache.maven.archiver.ManifestConfiguration for 'manifestEntries' -> [Help 1]


i googled for the api and found that the class ManifestConfiguration does have the set/get-ManifestEntry method - but the javadoc was for maven 2. Is this method no longer supported? How can i do this?

Thanks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5838
    
    7

Look at the syntax for the Archiver again: http://maven.apache.org/shared/maven-archiver/index.html
Note that the <manifestEntries> entries are NOT embedded within <manifest> entries.


JBoss In Action
olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
thanks, its running without failure but its not adding the line
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5838
    
    7

Try running mvn with the -X option (redirect the output to s file - there is a lot of it) and verify that the SPI-Consumer value is getting passed to the Assembly plugin. Also, post the contents of the resulting MANIFEST.MF file.

Another thought - try adding in at least one of the <manifest> entries, such as addDefaultImplementationEntries. Perhaps the manifest is not created unless you have at least one of those entries.
olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
its pretty easy to do this... i got this solved now:


simply put any key/value pairs in <instructions>, thats it (like: <hello>world</hello> which leads to: "hello: world" in the manifest.mf)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: maven3 - adding a line to manifest.mf