maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Curley (JIRA)" <>
Subject [jira] [Created] (MSHADE-203) "shadeTestJar" option not working?
Date Tue, 04 Aug 2015 22:34:04 GMT
Aaron Curley created MSHADE-203:

             Summary: "shadeTestJar" option not working?
                 Key: MSHADE-203
             Project: Maven Shade Plugin
          Issue Type: Bug
    Affects Versions: 2.4.1
            Reporter: Aaron Curley
            Priority: Minor

So, I'm pretty new to using the maven-shade-plugin and I'm not really that familiar with the
maven-shade-plugin's design/code; however, it appears that the <shadeTestJar> option
in the maven-shade-plugin configuration does not work correctly.  

While running "mvn package" in my project appears to perform the "test jar shading" step (after
performing the regular jar's shade), but the "shaded" test JAR doesn't not actually include
any shaded dependency files (it just includes the "original" test jar's contents, which is
essentially a "no-op").

--Possible Diagnosis--
I took a quick look at the release code base for v2.4.1, in particularly, the mojo/
file.  In the execute() method, at line 437, there is method call:
processArtifactSelectors( artifacts, artifactIds, sourceArtifacts, artifactSelector );
This method call appears to populate the "artifacts" and "sourceArtifacts" sets created earlier
in execute() but the code noticeably does not populate the similar "testArtifacts" set.  My
guess is that this is causing the "shade" operation to skip processing any artifacts for the
test jar shade operation (since only the project-level artifact is populated in the "testArtifacts"
set at line 432).

--Possible Solution--
(Obviously) Add an additional parameter to processArtifactSelectors() that accepts the additional
"testArtifacts" set.  Then, processArtifactSelectors could populate that set (much like it
does for the "sourceArtifacts" set at line 623).

Best wishes.  Like I said, I'm pretty new to this plugin, so the above may be incorrect.

This message was sent by Atlassian JIRA

View raw message