For what it's worth, I noticed the same thing a while back when setting up an offline system for a particular project at work. I was stunned at some of the artifacts being downloaded when invoking certain plugins. Thanks for looking into this and trying to improve the situation.
- Eric L On Thu, Mar 11, 2021 at 4:19 PM Tamás Cservenák <ta...@cservenak.net> wrote: > Howdy, > > just a quick question, I thought someone may enlighten me... > > Noticed, that Maven _resolves_ and _creates extension realms_ for things I > did not opt to at all. Typical example is nexus-staging-maven-plugin, that > maven 3.6.3 resolves at one moment in my build, despite not using it. > > So, what and why is maven-assembly-plugin doing this? > > === > > Here is an example project: > https://github.com/cstamas/mvn-md-bug > > Just add new dependency in POM, jackson for example that uses extensions in > it's own build (copy paste into POM): > > <dependency> > <groupId>com.fasterxml.jackson.core</groupId> > <artifactId>jackson-databind</artifactId> > <version>2.12.2</version> > </dependency> > > use vanilla maven 3.6.3 and run `mvn clean install -X` > > You will notice: > - plugin lists 3 dependencies of project (OK), 1 will be filtered out > (junit, test scope) OK > - and then bunch of extensions are being resolved and created and added to > maven (gitexe, gitsite, felix bundle plugin, and so on, up to > nexus-staging-maven-plugin). > > Here is a "plain" console output of the build, that creates assembly of 2 > JARs: > https://gist.github.com/cstamas/559b8083764ee7a9c9807551b73308f3 > > Scroll to line 834 (where massembly begins) and just watch what it > downloads... > > To me, it seems like assembly is doing much-much more than it should? Or am > unaware why dependency build extensions need to be loaded? > > Note: the assembly ends up OK, it has 2 jar in it. > > Thanks > T >