maven-shade-plugin icon indicating copy to clipboard operation
maven-shade-plugin copied to clipboard

[MSHADE-286] Shading fails when a dependency's main artifact does not exist

Open jira-importer opened this issue 7 years ago • 1 comments

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 shadeJar boolean with default value true, which disables shading of main artifacts in a similar way shadeTestJar, createSourcesJar and createTestSourcesJar work. 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:

jira-importer avatar Apr 02 '18 20:04 jira-importer

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...

jira-importer avatar Dec 25 '19 20:12 jira-importer