maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [maven-shade-plugin] rmannibucau commented on pull request #59: MSHADE-373: adds a property to skip manifest transformer application when transforming a source file.
Date Thu, 02 Jul 2020 15:23:25 GMT

rmannibucau commented on pull request #59:

   @raphw hmm, ok, let me try to reformulate because if I get it right I tend to see the "skip"
fix as a quick workaround but an inaccurate (hope next part explains why). So my understanding
is that createSourcesJar leads to a duplicated manifest in 2 different jars and this is an
issue for you because eclipse uses both jar in an OSGi container.
   My understanding of this issue leads me to these two lacks in current plugin we can fix:
   1. You can force a manifest entry to be ignore (I assume we can have a custom value to
say 'ignore if I'm equals to X" - org.apache.maven.shade.ignore for example - and then it
can be forced in manifest transformer and enables to drop manifest entries from the original
manifest (thinking to OSGi -> SE fatjar case for example).
   2. Implicit source shade has no manifest customization which means in org.apache.maven.plugins.shade.mojo.ShadeMojo#createSourcesJar
we fully inherit from the main shade and therefore the manifest is 1-1 with the original artifact.
I would add a flag in ManifestTransformer to mimic the mojo config ("main", "source", "test",
"test source")  with each one having a "manifestEntries" customization set which would enable
to select the right "manifestEntries" for each shade and to users (you) to override some values.
It just means we must filter per shade "phase" the right manifest but this is not something
crazy IMHO. Finally, for backward compatibility, if there is no transformer for phase X we
would keep using the main one.
   Here is a pseudo config illustrating that:
       <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
       <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"
           <manifestEntries></manifestEntries> <!-- set what you need -->
       <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"
forShade="test" />
       <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"
forShade="test-sources" />
   Does it make sense or did I get it wrong?

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.

For queries about this service, please contact Infrastructure at:

View raw message