Hi Romain, thank you very much for your reply!
I did not understand fully, what you wrote, so please allow me to clarify with some questions: > We can set property values foe most params. Yes, although the "finalName" and "minimizeJar" parameters are not supported on the command line, which are the two important ones for our use-case. I would like to understand, if there never was any demand for setting this parameters on the command line, or, if there are technical reasons for not providing them. > Side note: an option you can use is an extension which would auto configure > shade plugin. Customizes mvn instance (ext/ or using a custom launcher/cp) > over the project descriptors. I found this information on extensions: https://maven.apache.org/guides/mini/guide-using-extensions.html Please let me phrase it in my own words to check if I understand your suggestion/guessing right what you imply: - We build an extension, which enhances the 'in-memory' POM with our parameters and the Maven Shade plugin - We would hook the extension into a lifecycle phase like pre-validate or pre-package (?) - How could we call/incorporate the extension from the command line? The example says to add the extension to the POM file and gives no example how to use it from the command line (https://maven.apache.org/examples/maven-3-lifecycle-extensions.html) Further, our team is still puzzled, why the Maven Shade plugin has a message, that CLI usage is not supported and it seems there is no interest for exposing more parameters via the command line. Do you happen to know why this is an issue or perhaps could point me to some resources, which might help me to learn about the technical or cultural reasons for this? Kind regards, Wolfram On 31.08.21, 21:37, "Romain Manni-Bucau" <[email protected]> wrote: Hi We can set property values foe most params. Side note: an option you can use is an extension which would auto configure shade plugin. Customizes mvn instance (ext/ or using a custom launcher/cp) over the project descriptors. Le mar. 31 août 2021 à 19:05, Fischer, Wolfram <[email protected]> a écrit : > Hi all, > > we (research team) use the Apache Maven Shade Plugin to identify bloated > code. > > We execute the shade plugin with the minimizeJar option and compare the > classes which end up in the generated fat jar with the complete set of > classes from the project and its direct and transitive dependencies. > > To automate this, we had to expose the finalName and minimizeJar > parameters as properties to set them from the command line. > > Modifying the pom.xml files is not an option for us, because we run the > shade plugin against hundreds of projects. > > Why is it not supported to execute the shade plugin from the command line > [0]? > > When we compared the output of the shade plugin configured via the pom.xml > file and using our modified shade plugin from the command line, we got > exactly the same results. > > I would happily create a PR and expose a subset or all parameters via the > property attribute in the Parameter annotations. > > Kind regards, > Wolfram > > [0] > https://github.com/copyonwrite/maven-shade-plugin/blob/c648ccfade767acd5a59893a1719b58ed02fad99/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java#L644 >
