Johan Sjöberg
Johan Sjöberg

Reputation: 49237

How to download dependencies inside a maven plugin?

What's the best way to download remote maven artifact from within a maven plugin while also supporting maven 2.2.x1), 3.0.x, 3.1.x and newer?

Aether seems a good candidate but it changed package namespace between 3.0.5 and 3.1 breaking compatibility.

There's pieces of information around,

So what's the correct, or at least working, way to go on about this?

1) Where Maven 2.2.x is a nice to have as pointed out by @khmarbaise is EoL

Upvotes: 8

Views: 388

Answers (1)

Riduidel
Riduidel

Reputation: 22308

If you're in a plugin and want to have another plugin invoked, the best solution - by far - is to use Mojo Executor. This way, you won't rewrite the maven-dependency-plugin ... Considering the maven version issues, well, I guess you should indeed give up on maven 2.* support.

Upvotes: 1

Related Questions