[
https://jira.codehaus.org/browse/MASSEMBLY-737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=358736#comment-358736
]
Kristian Rosenvold commented on MASSEMBLY-737:
----------------------------------------------
the jar specification requires that the manifest file be the first file in the
archive (the zip file). This is a royal PITA, since any items that have to go
into the manifest have to be known up-front. plexus-io/plexus-archiver is
generally as deferred as possible, meaning it lazily resolves anything you ask
it for. Currently the assembly plugin "solves" this by being 2-pass; it reads
all of the files specified in all the assembly descriptors. If any of them
contain "stuff" that is supposed to go into the descriptor it writes the
appropriate descriptor. It would be possible to add the scan for existing
manifests to this first pass of the archiver. I really don't like us being
2-pass over the source specifications in assembly and would really like to
reduce this to a single pass operation. In this case we'd have to re-write the
entire archive at the end if we discover things that are "worthy" of a manifest
entry. I'm not entirely ready to claim defeat on this yet, but it really means
that we need to be able to re-write the zip file with a new manifest entry (and
preferably without decompressing/recompressing) on the fly. So the moment I
give up on all these ambitions and accept the 2-pass strategy it all becomes
simple. But I'm not here for "simple"
> Generated WAR file does not contain the same default manifest entries as
> created by the Maven WAR Plugin
> --------------------------------------------------------------------------------------------------------
>
> Key: MASSEMBLY-737
> URL: https://jira.codehaus.org/browse/MASSEMBLY-737
> Project: Maven Assembly Plugin
> Issue Type: Bug
> Components: manifest, maven-archiver
> Affects Versions: 2.5.2
> Reporter: Michael Osipov
> Fix For: 2.5.3
>
> Attachments: massembly-737.zip
>
>
> I am repackaging a WAR file with some files exchanged. The original fiel
> contains following manifest entries:
> {noformat}
> Manifest-Version: 1.0
> Built-By: osipovmi
> Build-Jdk: 1.7.0_55
> Created-By: Apache Maven 3.2.2
> Archiver-Version: Plexus Archiver
> {noformat}
> The {{MANIFEST.MF}} generated by this plugin looks like:
> {noformat}
> Manifest-Version: 1.0
> Created-By: 24.55-b03 (Oracle Corporation)
> Archiver-Version: Plexus Archiver
> {noformat}
> while the descriptor looks very simple:
> {code}
> <assembly
>
> xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
> http://maven.apache.org/xsd/assembly-1.1.2.xsd">
> <id>deployable</id>
> <formats>
> <format>war</format>
> </formats>
> <includeBaseDirectory>false</includeBaseDirectory>
> <dependencySets>
> <dependencySet>
> <unpack>true</unpack>
> <useProjectArtifact>false</useProjectArtifact>
> </dependencySet>
> </dependencySets>
> </assembly>
> {code}
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)