You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2016/04/30 02:06:12 UTC

[jira] [Comment Edited] (MJAR-193) Allow other mojos to contribute to the manifest

    [ https://issues.apache.org/jira/browse/MJAR-193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15264982#comment-15264982 ] 

Carsten Ziegeler edited comment on MJAR-193 at 4/30/16 12:05 AM:
-----------------------------------------------------------------

Getting back to this issue, as the archiver is the one creating the jar and the archiver gets the configuration for the manifest, would it be possible to somehow have a way to provide additional manifest entries (manifestEntries configuration http://maven.apache.org/shared/maven-archiver/index.html) by a plugin? It basically means doing something like mentioned in http://maven.apache.org/shared/maven-archiver/examples/manifestEntries.html via any mojo.

In other plugins we used the maven project object for these things: one plugin sets context values on the project object, a later plugin picks them up (if existing) and uses them in addition to process them. If we could do something similar here, e.g. the jar plugin (or the archiver?) looking at context values which keys start with a predefined value like "jar:manifest:entry:".
Of course if there is a nicer way that would even be better.
But I think having a way for a mojo to contribute to the manifest is really a great addition as this would allow any plugin to contribute to the manifest, and makes the use case of different mojos contributing different attributes for the manifest possible. Something which doesn't work at all and it's up to the user to correct this and configure the correct mojo with all necessary things.


was (Author: cziegeler):
Getting back to this issue, as the archiver is the one creating the jar and the archiver gets the configuration for the manifest, would it be possible to somehow have a way to provide additional manifest entries (manifestEntries configuration http://maven.apache.org/shared/maven-archiver/index.html) by a plugin?
In other plugins we used the maven project object for these things: one plugin sets context values on the project object, a later plugin picks them up (if existing) and uses them in addition to process them. If we could do something similar here, e.g. the jar plugin (or the archiver?) looking at context values which keys start with a predefined value like "jar:manifest:entry:".
Of course if there is a nicer way that would even be better.
But I think having a way for a mojo to contribute to the manifest is really a great addition as this would allow any plugin to contribute to the manifest, and makes the use case of different mojos contributing different attributes for the manifest possible. Something which doesn't work at all and it's up to the user to correct this and configure the correct mojo with all necessary things.

> Allow other mojos to contribute to the manifest
> -----------------------------------------------
>
>                 Key: MJAR-193
>                 URL: https://issues.apache.org/jira/browse/MJAR-193
>             Project: Maven JAR Plugin
>          Issue Type: Improvement
>            Reporter: Carsten Ziegeler
>             Fix For: waiting-for-feedback
>
>
> It would be great to have a programmatic way to add entries to the manifest from other mojos. The most important client of such a way would be the maven bundle plugin (from the Apache Felix project) that calculates additional headers for OSGi bundles. Right now, that bundle does not only do the calculation but generates the jar file as well.
> While a workaround would be to let the bundle plugin generate the full manifest and configure the jar plugin to use it, this is not very elegant. Passing down a map of manifest entries from one mojo to the jar plugin would solve this in a much better way.
> And I could imagine that other mojos/plugins might benefit for this as well.
> This would be a simple but very convenient enhancement to the plugin



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)