|
[
Permalink
| « Hide
]
Andrew Perepelytsya added a comment - 30/Mar/08 06:05 PM
2.2-beta-2 is badly broken due to this. Does it really take so much time to fix the regression? Pleease?
This is reproduced when one tries e.g. to configure permissions on the files in the directory using multiple include/exclude patterns. Each FileSet is instead copied and duplicated in zip. E.g. real config that broke: http://svn.galaxy.muleforge.org/browse/galaxy/trunk/netboot/mule1/distribution/assembly.xml?r=487
This jacks up my world as my jar signer freaks out when it sees the duplicate files.
I'm having this problem too when making a WAR file.
Any news on a possible fix?? It's been 3 weeks now without an update. This is happening also with tar.gz format.
The resulting tar file contains many copies of several Jar artifacts, multiplying its size by ~4. When extracting, only one copy is left per artifact. I have a project with several submodules, each of them creates a ZIP during build.
When I build submodules one by one, they produce correct ZIPs. Similar situation while assembling multimodule project to ZIP using
<moduleSets> <moduleSet> <includes> ... in assembly.xml I found this bug while trying to merge 2 <fileset> directories expecting that the 2nd would overwrite the first set of files where they overlap (in using one fileset as "default" files and the 2nd fileset as overrides). The result was as described in the bug - 2 identical files added to the resulting zip file. Upon extraction of the zip, I was prompted for an option to override one of the files. I also verified that the case on both files was lower case, so its NOT an issue with the same filename with different case; ie creating the archive on unix and extracting on Windows. This bug has been open for a long time. It would be appreciated if this was fixed ASAP. Its a huge blocker. Thanks! example assembly.xml file: <assembly xmlns="http://maven.apache.org/POM/4.0.0" <id>bin</id> <formats> <fileSets> </assembly> Until this is fixed, here is an example work around, if you are interested (the modules parent is a default jboss-assembly module - the child module inherits the src and config of the default jboss-assembly): pom.xml: <plugins> <!-- generate resources. merge default and current configurations. --> <-- maven assembly plugin --> You'll need to specify the following in your plugin's configuration section:
<archiverConfig> <duplicateBehavior>skip</duplicateBehavior> </archiverConfig> the default duplicates setting for the zip archiver is "add", meaning allow duplicates. This logic has been preserved, and using the archiverConfig element of the plugin configuration you an override it. BTW, the duplicates-handling logic from the zip archiver has been generalized out to the AbstractArchiver, so all archivers should handle it.
With following configuration placed in parent's POM:
<plugin> used in multimodule project (parent, then few modules as child), this is still adding duplicates into the final ZIP archive. <duplicateBehaviour>fail</duplicateBehaviour> does not fail as well. I will appreciate any help. With duplicateBehavior instead of duplicateBehaviour (one letter changed) it still does not work.
Shouldn't the default behaviour be the 'correct' behaviour? What percentage of people actually want duplicate files in their artefacts?
Why should we try to preserve incorrect behaviour? This sort of thing cripples products - just look at the www. Please point it out if there's something I'm missing. I heartily agree with Antony here - please reopen this issue!
+1, following Maven's spirit of "convention over configuration" where the convention of course should be sensible, i.e. cover the major use case. I agree that the default behaviour should be to not allow duplicates. I also think that the default should be to overwrite, not to skip. So that it works just like copying files to a directory.
I strongly agree. Every time we have to put workarounds in our poms we're just taking another step back to ant build.xmls. I honestly can't think of any case where it would be useful to have two of the same file in an archive. My vote would be to overwrite and warn.
+1 on defaulting to overwrite, at least if the assembly is building a jar or a war...
Hi everyone, glad to see you all agree!
Have opened a new issue to cover this, as this one has been officially closed and doesn't seem to be getting much attention: Please go and vote for it! default behavior is set to skip. Because of the way archive resources are processed, implementing overwrite is going to be a lot more involved. From the perspective of the assembly plugin, overwrite vs. skip doesn't make much difference, since users cannot control which type of assembly section is processed first, and any of them could overwrite entries from any other. Having duplicate files that are different will lead to non-deterministic results as long as you're not talking about any two specific sections, or entries within a single section, so there is no difference in the general case between skip and overwrite.
In terms of two fileSets, however, it makes sense to allow overwrites. Since this is pretty complex to implement in plexus-archiver, I'll create a new issue for it and assign it to 2.2 (final). verified as fixed in src/it/projects/bugs/massembly-285
Let me make sure I'm clear on this. If my assembly.xml file has a "dependencySets" node (containing a single "dependencySet") followed by a "fileSets" node (containing a single "fileSet"), neither the order of the nodes nor the intrinsic meaning of the nodes affects the order in which they are processed? The processing order is non-deterministic?
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||