Benjamin Bentmann wrote:

> Jörg Schaible wrote:
> 
>> Is it save now in M3 to declare a different plugin artifact as
>> dependency?
> 
> You mean plugin A having a dependency on plugin B? This shouldn't cause
> an issue for Maven 3 when running the plugin (it should also work in
> recent Maven 2.x releases IIRC).

No, it does not really work in M2, since the plugin is loaded only once and 
this can break your build in unexpected ways. Imagine B is the assembly 
plugin and A depends on version 2.1 of it that allows the id/classifier to 
be empty. The user however uses the assembly plugin in the latest version 
2.2. If at build time version 2.1 is active, the project may fail simply 
because that version cannot read the latest assemblies. If at build time 
version 2.2 is active, it will fail because of empty id/classifier.

M3 was supposed to use separate classloaders for its plugins. In that case A 
would use assembly plugin version 2.1 while the build itself would use 2.2. 
Does this work now?

> That inheriting from other plugins isn't really recommended and not
> supported by the plugin tooling, is a different story.

Until now (M2) for a very good reason. Sadly there has been never any 
emphasis on that recommendation (better: requirement?). We've been bitten by 
this (xmlbeans plugin depending on antrun plugin) and we currently do not 
allow the usage of any plugin that uses another one as dependency.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to