[ http://jira.codehaus.org/browse/MNG-2456?page=all ]
Max Bowsher updated MNG-2456:
-----------------------------
Attachment: MNG-2456-maxb.patch
Since I cannot override a core component from a POM, I have made a workaround
that fixes the behaviour at the maven-archiver level. I am attaching a patch
against maven-archiver-2.2.
My patch is generally along the same fundamental approach as Baerrach's, but
with the following differences:
* aims to fix the problem with minimal changes, instead of including
refactoring mixed with the fix.
* applies the fix to the jar indexing codepath too.
* tries to avoid hardcoding the details of how to construct artifact filenames.
In that last point, it is only partially successful - I could not work out how
to get hold of an appropriate ArtifactRepository object within maven-archiver,
so I resorted to making the twin assumptions:
1. that the existing filepath would contain the correct path, and only the
basename need be fixed up.
2. that a DefaultRepositoryLayout object would give me the correct basename.
In practice this seems to work, even if it is a little ugly.
> Maven Archiver creates incorrect Class-Path entry in Manifest for deployed
> snapshots
> ------------------------------------------------------------------------------------
>
> Key: MNG-2456
> URL: http://jira.codehaus.org/browse/MNG-2456
> Project: Maven 2
> Issue Type: Bug
> Components: maven-archiver
> Affects Versions: 2.0.4
> Reporter: Baerrach bonDierne
> Attachments: MNG-2456-maxb.patch, MNG-2456-patch.txt,
> MNG-2456-step1-refactoring-patch.txt,
> MNG-2456-step2-add-test-cases-patch.txt, MNG-2456-step3-fix-bug-patch.txt
>
>
> See related problems MJAR-28 and MASSEMBLY-67.
> Summary:
> The Maven-Archiver uses the file part of the artifact's filename to create
> the Class-Path entries in the Manifest.
> This works fine for released artifacts and non-deployed snapshot.
> The problem occurs when using a deployed snapshot as the assembly plugin will
> copy the dependency as ${artifactId}-${version}-timestampedversion.jar and
> the entry in the Class-Path will be ${artifactId}-${version}-SNAPSHOT
> thus use of java -jar <jarfile> will fail because of the differing names.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira