jira-importer commented on issue #225:
URL: 
https://github.com/apache/maven-jar-plugin/issues/225#issuecomment-2956682883

   **[Jochen 
Wiedmann](https://issues.apache.org/jira/secure/[email protected])**
 commented
   
   I'll attach three files, which together build a proposed patch. As the patch 
is comparatively large (although technically there isn't too much happening), 
it seemed wise to use three patch files, each of which introduce another change.
   
   The patch doesn't attempt to really fix the problem: Fixing it doesn't look 
so trivial, at least not without taking decisions which are beyond a mere 
contributors scope. Instead the patch introduces a possible workaround, which 
seems reasonably conservative.
   
   The patchs idea is as follows: Currently it is **not** possible to specify 
values like "Extension-Name", and the like, besides the automatically choosen 
values. If you do, then an exception is raised, which tells you, that you 
cannot overwrite a manifest entry. Obviously, this is not desirable. So it 
seems reasonable to specify, that explicitly specified manifest entries 
overwrite implicit values.
   
   The patches purpose is as follows:
   
   1.) Introduces a new method getManifest(MavenProject, 
MavenArchiveConfiguration), which is preferrable
   over getManifest(MavenProject, ManifestConfiguration). Moves some 
functionality from
   createArchive(MavenProject, MavenArchiveConfiguration) to the new method. 
(One would possibly
   move more functionality from createArchive to getManifest or leave it all 
where it is. However, the
   new method demonstrates what's required for the change.)
   
   2.) Introduces a new method getManifest(MavenProject, MavenConfiguration, 
Map), which is internally
   used by the other getManifest methods. The map is the map of manifest 
entries, if available, or an
   empty Map. Rationale of the empty Map is that everything should like it was 
without the Map.
   
   3.) Replaces all explicit calls to addConfiguredAttribute with a new method 
addManifestAttribute. The
   new method checks, whether there already is an explicit value. If so, it 
prefers the explicit value
   over the implicit value.
   
   Note, that my current implementation changes the Map, which it receives as a 
parameter. This should possibly be changed, for example by replacing the 
parameter with a copy.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to