So far what I've done is change the parent POM to configure this additional
plugin in the none phase, and then remap the jar packaging type and include
it there.

This seems to work, but I'm wondering whether there is better approach.

On Wed, Oct 7, 2020 at 7:47 AM Alvaro Sanchez-Mariscal <
alvaro.sanchezmaris...@gmail.com> wrote:

> Hi,
>
> I'm writing a plugin that intends to support custom packaging types.
>
> The plugin's components.xml looks like:
>
> <component-set>
>     <components>
>         <component>
>
> <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
>             <role-hint>my-custom-type</role-hint>
>             <implementation>
>                 org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping
>             </implementation>
>             <configuration>
>                 <lifecycles>
>                     <lifecycle>
>                         <id>default</id>
>                         <phases>
>                             <package>
>                                 com.foo:foo-maven-plugin:bar
>                             </package>
>                         </phases>
>                     </lifecycle>
>                 </lifecycles>
>             </configuration>
>         </component>
>     </components>
> </component-set>
>
> The user's project (where this plugin will be used) have a parent POM that
> binds an additional plugin into the package phase.
>
> The problem is that, when executing mvn package, it runs not only
> com.foo:foo-maven-plugin:bar, but also this additional plugin.
>
> Is there a way to avoid this?
>
> Note that the parent POM is under my control and I could make changes to
> it as well if needed.
>
> Cheers,
> --
> Álvaro Sánchez-Mariscal
> alvaro.sanchezmaris...@gmail.com
> twitter.com/alvaro_sanchez
>


-- 
Álvaro Sánchez-Mariscal
alvaro.sanchezmaris...@gmail.com
twitter.com/alvaro_sanchez

Reply via email to