Re: Custom packaging

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Custom packaging

Alvaro Sanchez-Mariscal
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 <
[hidden email]> 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
> [hidden email]
> twitter.com/alvaro_sanchez
>


--
Álvaro Sánchez-Mariscal
[hidden email]
twitter.com/alvaro_sanchez