You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dennis Lundberg (JIRA)" <ji...@codehaus.org> on 2012/11/02 21:41:13 UTC
[jira] (MASSEMBLY-450) manifestEntries ignored when manfestFile is
specified
[ https://jira.codehaus.org/browse/MASSEMBLY-450?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dennis Lundberg updated MASSEMBLY-450:
--------------------------------------
Component/s: manifest
Description:
The maven jar plugin supports the behavior of manifestEntries overriding the manifestFile as indicated here:
http://maven.apache.org/guides/mini/guide-manifest.html
However, within the maven assembly plugin, if manifestFile is specified, manifestEntries is ignored.
Reproduction
============
{noformat}
> unzip example.zip
> cd example
> mvn package
> cd target
> unzip example-4.2-plugin.jar
> cat META-INF/MANFEST
{noformat}
Results:
{noformat}
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: 14.0-b16 (Sun Microsystems Inc.)
Bundle-ManifestVersion: 2
Bundle-Name: example
Bundle-SymbolicName: example; singleton:=true
Bundle-Version: 1.0
{noformat}
Expected:
{noformat}
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: 14.0-b16 (Sun Microsystems Inc.)
Bundle-ManifestVersion: 2
Bundle-Name: example
Bundle-SymbolicName: example; singleton:=true
Bundle-Version: 4.2
{noformat}
The problem appears to be in the class ManifestConfigurationFinalizer:
{code:java}
if ( manifestFile != null )
{
...
manifest = new Manifest( manifestFileReader );
...
}
else
{
manifest = mavenArchiver.getManifest( project, archiveConfiguration.getManifest() );
}
{code}
I believe the fix is to change to the following (this already handles merging the manifest file with the configured manifestEntries)
{code:java}
manifest = mavenArchiver.getManifest( project, archiveConfiguration );
{code}
was:
The maven jar plugin supports the behavior of manifestEntries overriding the manifestFile as indicated here:
http://maven.apache.org/guides/mini/guide-manifest.html
However, within the maven assembly plugin, if manifestFile is specified, manifestEntries is ignored.
Reproduction
============
> unzip example.zip
> cd example
> mvn package
> cd target
> unzip example-4.2-plugin.jar
> cat META-INF/MANFEST
Results:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: 14.0-b16 (Sun Microsystems Inc.)
Bundle-ManifestVersion: 2
Bundle-Name: example
Bundle-SymbolicName: example; singleton:=true
Bundle-Version: 1.0
Expected:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: 14.0-b16 (Sun Microsystems Inc.)
Bundle-ManifestVersion: 2
Bundle-Name: example
Bundle-SymbolicName: example; singleton:=true
Bundle-Version: 4.2
The problem appears to be in the class ManifestConfigurationFinalizer:
if ( manifestFile != null )
{
...
manifest = new Manifest( manifestFileReader );
...
}
else
{
manifest = mavenArchiver.getManifest( project, archiveConfiguration.getManifest() );
}
I believe the fix is to change to the following (this already handles merging the manifest file with the configured manifestEntries)
manifest = mavenArchiver.getManifest( project, archiveConfiguration );
> manifestEntries ignored when manfestFile is specified
> -----------------------------------------------------
>
> Key: MASSEMBLY-450
> URL: https://jira.codehaus.org/browse/MASSEMBLY-450
> Project: Maven 2.x Assembly Plugin
> Issue Type: Bug
> Components: manifest
> Affects Versions: 2.2-beta-4
> Reporter: Robert Cauble
> Attachments: example.zip
>
>
> The maven jar plugin supports the behavior of manifestEntries overriding the manifestFile as indicated here:
> http://maven.apache.org/guides/mini/guide-manifest.html
> However, within the maven assembly plugin, if manifestFile is specified, manifestEntries is ignored.
> Reproduction
> ============
> {noformat}
> > unzip example.zip
> > cd example
> > mvn package
> > cd target
> > unzip example-4.2-plugin.jar
> > cat META-INF/MANFEST
> {noformat}
> Results:
> {noformat}
> Manifest-Version: 1.0
> Archiver-Version: Plexus Archiver
> Created-By: 14.0-b16 (Sun Microsystems Inc.)
> Bundle-ManifestVersion: 2
> Bundle-Name: example
> Bundle-SymbolicName: example; singleton:=true
> Bundle-Version: 1.0
> {noformat}
> Expected:
> {noformat}
> Manifest-Version: 1.0
> Archiver-Version: Plexus Archiver
> Created-By: 14.0-b16 (Sun Microsystems Inc.)
> Bundle-ManifestVersion: 2
> Bundle-Name: example
> Bundle-SymbolicName: example; singleton:=true
> Bundle-Version: 4.2
> {noformat}
> The problem appears to be in the class ManifestConfigurationFinalizer:
> {code:java}
> if ( manifestFile != null )
> {
> ...
> manifest = new Manifest( manifestFileReader );
> ...
> }
> else
> {
> manifest = mavenArchiver.getManifest( project, archiveConfiguration.getManifest() );
> }
> {code}
> I believe the fix is to change to the following (this already handles merging the manifest file with the configured manifestEntries)
> {code:java}
> manifest = mavenArchiver.getManifest( project, archiveConfiguration );
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira