maven-shade-plugin
maven-shade-plugin copied to clipboard
[MSHADE-286] Shading fails when a dependency's main artifact does not exist
Peter De Maeyer opened MSHADE-286 and commented
Shading fails when a dependency's main artifact does not exist, see the methods ShadeMojo.invalidMainArtifact/createErrorOutput and their caller.
A similar existence check (luckily) does not exist for the other artifacts: test jar, sources, and test sources.
This was done intentionally, but it's overly strict because it prohibits a legitimate use case: some projects don't produce a main artifact, but only e.g. a test artifact.
Such projects can't be shaded because of this existence check.
It would be better to:
- Get rid of this check, or at least relax it, such that shading also works for projects that don't produce a main artifact.
- Complete the symmetry between jar, test jar, sources and test sources by adding a
shadeJarboolean with default valuetrue, which disables shading of main artifacts in a similar wayshadeTestJar,createSourcesJarandcreateTestSourcesJarwork. This will allow shading to disable creation of a main artifact altogether, even when the dependencies do have a main artifact.
Affects: 3.1.0
Issue Links:
- MSHADE-284 Shaded test JARs are always empty
Peter De Maeyer commented
Mark Struberg, I noticed you assigned this to yourself - are you working on this? I'm working on a fix myself too...