[ 
https://issues.apache.org/jira/browse/MSHADE-478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17849955#comment-17849955
 ] 

ASF GitHub Bot commented on MSHADE-478:
---------------------------------------

cstamas commented on code in PR #228:
URL: 
https://github.com/apache/maven-shade-plugin/pull/228#discussion_r1616945401


##########
src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java:
##########
@@ -393,6 +392,36 @@ public class ShadeMojo extends AbstractMojo {
     @Parameter(defaultValue = "false")
     private boolean skip;
 
+    /**
+     * Extra JAR files to infuse into shaded result.
+     * <p>
+     * One can add here "extra JARs", to be worked into the resulting shaded 
JAR. The listed JAR files must exist.
+     * Extra JARs will be processed in same way as main JAR (if any): applied 
relocation, resource transformers
+     * but not filtering.
+     * <p>
+     * Note: this feature should be used lightly, is not meant as ability to 
replace dependency hull! It is more
+     * just a feature to be able to slightly "differentiate" shaded JAR from 
main only.
+     *
+     * @since 3.6.0
+     */
+    @Parameter
+    private List<File> extraJars;

Review Comment:
   pushed update



##########
src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java:
##########
@@ -393,6 +392,36 @@ public class ShadeMojo extends AbstractMojo {
     @Parameter(defaultValue = "false")
     private boolean skip;
 
+    /**
+     * Extra JAR files to infuse into shaded result.
+     * <p>
+     * One can add here "extra JARs", to be worked into the resulting shaded 
JAR. The listed JAR files must exist.
+     * Extra JARs will be processed in same way as main JAR (if any): applied 
relocation, resource transformers
+     * but not filtering.
+     * <p>
+     * Note: this feature should be used lightly, is not meant as ability to 
replace dependency hull! It is more
+     * just a feature to be able to slightly "differentiate" shaded JAR from 
main only.
+     *
+     * @since 3.6.0
+     */
+    @Parameter
+    private List<File> extraJars;
+
+    /**
+     * Extra Artifacts to infuse into shaded result.
+     * <p>
+     * One can add here "extra Artifacts" to be worked into the resulting 
shaded JAR. The artifacts will be resolved
+     * (not transitively), and will be processed in same way as dependency 
JARs (if any): regarding relocation,
+     * resource transformers and filtering.
+     * <p>
+     * Note: this feature should be used lightly, is not meant as ability to 
replace dependency hull! It is more
+     * just a feature to be able to slightly "differentiate" shaded JAR from 
main only.
+     *
+     * @since 3.6.0
+     */
+    @Parameter
+    private List<String> extraArtifacts;

Review Comment:
   pushed update





> Add ability to inject extra artifacts into shaded output
> --------------------------------------------------------
>
>                 Key: MSHADE-478
>                 URL: https://issues.apache.org/jira/browse/MSHADE-478
>             Project: Maven Shade Plugin
>          Issue Type: New Feature
>            Reporter: Tamas Cservenak
>            Assignee: Tamas Cservenak
>            Priority: Major
>             Fix For: 3.6.0
>
>
> Use case: Let's assume your main artifact is a "plugin" of some sort. 
> Moreover, assume that the "host" of your plugin uses SLF4J API for logging, 
> hence the module have {{slf4j-api}} declared as compile dependency (or 
> provided, does not matter). Still, you want to create a self contained JAR 
> out of same module, hence shade it. But the problem is given: how would 
> standalone JAR log?
> You should be able to "inject" extra JARs, but at the same time to have all 
> the "benefits" of all resource transformers as well (ie. your "extra 
> artifact" may have Sisu components, or Service providers).
> The {{extrajars}} IT showcase this very scenario.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to