You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Konrad Windszus <kw...@apache.org> on 2022/07/04 06:48:01 UTC

JSR330: Overriding the default lifecycle

Hi,
What is the best way to get rid of plexus metadata (components.xml) and override the default lifecycle mapping for a certain type (as outlined in https://blog.sonatype.com/2009/08/create-a-customized-build-process-in-maven/) only leveraging JSR 330 annotations (https://github.com/eclipse/sisu.plexus/wiki/Plexus-to-JSR330)?

I guess I have to convert the XML configuration to a simple Java class with annotations. Is there no configuration via metadata files available in Sisu?

Also prior 2020 (https://github.com/apache/maven/commit/6c7d105916bb288b1f0f7010035c718f16e11240, only part of Maven 4) there was only the default constructor and the private field lifecycles (https://github.com/apache/maven/blob/673a7d1fef55795ea47a147f158a1411475e7495/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java#L33) so I would have to work with reflection to inject the correct configuration.

Any hints highly appreciated.
Konrad
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: JSR330: Overriding the default lifecycle

Posted by Konrad Windszus <kw...@apache.org>.
For the record: Both plexus metadata and JSR 330 annotated classes work the same way. I had a typo in the group id. 

Still one thing might be relevant to others: It is never necessary to explicitly set the version for goals of the plugin itself (as this always has a version set in the effective pom.xml). Only for other plugins it is best practice to always set versions (otherwise Maven would check the remote repo for the latest version and in general builds are far less reproducible).

Thanks again for all the helpful input.
Konrad

On 2022/07/14 08:26:59 Konrad Windszus wrote:
> I tried to come up with an implementation in https://github.com/apache/jackrabbit-filevault-package-maven-plugin/pull/81, but there is a subtle difference to using plexus metadata. Now plugins versions inside the mapping are required, with plexus metadata they weren't. Does anyone know where the difference comes from?
> 
> Thanks,
> Konrad
> 
> 
> On 2022/07/14 07:10:08 Konrad Windszus wrote:
> > Hi Tamás,
> > thanks a lot for that example. Unfortunately one cannot use `o.a.m.lifecycle.mapping.Lifecycle.setPhases(Map<String,String>)` due to https://issues.apache.org/jira/browse/MNG-5958 in Maven [3.3.9,3.5.0).
> > So an implementation of LifecycleMapping or Provider<LifecycleMapping> is unfortunately requiring a lot of glue code currently...
> > 
> > Konrad
> > 
> > 
> > On 2022/07/12 14:23:26 Tamás Cservenák wrote:
> > > Howdy,
> > > 
> > > just for fun I hit the same issue, and this is how I got rid of Plexus XML
> > > https://github.com/apache/maven-rar-plugin/pull/3/files#diff-b7fae2df008a8b4ad8bc93e5c2229a5768fbdc77e904615d706c5c29e5ad4997
> > > 
> > > HTH
> > > T
> > > 
> > > On Wed, Jul 6, 2022 at 4:26 PM Konrad Windszus <kw...@apache.org> wrote:
> > > 
> > > >
> > > >
> > > > On 2022/07/06 14:18:28 Tamás Cservenák wrote:
> > > > > Maven 3.0 did not support sisu-index (produced by sisu-maven-plugin
> > > > during
> > > > > build), but 3.1 onward does support it.
> > > > >
> > > > > Hence. If you support Maven 3.0 inclusive, you must stick with plexus
> > > > xml,
> > > > > otherwise is not required.
> > > > >
> > > > > T
> > > >
> > > > The problem is not the support of sisu-index but rather the missing
> > > > constructor or public fields of
> > > > https://github.com/apache/maven/blob/maven-3.8.6/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java
> > > > and I don't want to implement
> > > > https://github.com/apache/maven/blob/90c084dcf495e73c679395bc4b050500cbccf8cf/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMapping.java#L28
> > > > from scratch.
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: dev-help@maven.apache.org
> > > >
> > > >
> > > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: JSR330: Overriding the default lifecycle

Posted by Konrad Windszus <kw...@apache.org>.
I tried to come up with an implementation in https://github.com/apache/jackrabbit-filevault-package-maven-plugin/pull/81, but there is a subtle difference to using plexus metadata. Now plugins versions inside the mapping are required, with plexus metadata they weren't. Does anyone know where the difference comes from?

Thanks,
Konrad


On 2022/07/14 07:10:08 Konrad Windszus wrote:
> Hi Tamás,
> thanks a lot for that example. Unfortunately one cannot use `o.a.m.lifecycle.mapping.Lifecycle.setPhases(Map<String,String>)` due to https://issues.apache.org/jira/browse/MNG-5958 in Maven [3.3.9,3.5.0).
> So an implementation of LifecycleMapping or Provider<LifecycleMapping> is unfortunately requiring a lot of glue code currently...
> 
> Konrad
> 
> 
> On 2022/07/12 14:23:26 Tamás Cservenák wrote:
> > Howdy,
> > 
> > just for fun I hit the same issue, and this is how I got rid of Plexus XML
> > https://github.com/apache/maven-rar-plugin/pull/3/files#diff-b7fae2df008a8b4ad8bc93e5c2229a5768fbdc77e904615d706c5c29e5ad4997
> > 
> > HTH
> > T
> > 
> > On Wed, Jul 6, 2022 at 4:26 PM Konrad Windszus <kw...@apache.org> wrote:
> > 
> > >
> > >
> > > On 2022/07/06 14:18:28 Tamás Cservenák wrote:
> > > > Maven 3.0 did not support sisu-index (produced by sisu-maven-plugin
> > > during
> > > > build), but 3.1 onward does support it.
> > > >
> > > > Hence. If you support Maven 3.0 inclusive, you must stick with plexus
> > > xml,
> > > > otherwise is not required.
> > > >
> > > > T
> > >
> > > The problem is not the support of sisu-index but rather the missing
> > > constructor or public fields of
> > > https://github.com/apache/maven/blob/maven-3.8.6/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java
> > > and I don't want to implement
> > > https://github.com/apache/maven/blob/90c084dcf495e73c679395bc4b050500cbccf8cf/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMapping.java#L28
> > > from scratch.
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: JSR330: Overriding the default lifecycle

Posted by Konrad Windszus <kw...@apache.org>.
Hi Tamás,
thanks a lot for that example. Unfortunately one cannot use `o.a.m.lifecycle.mapping.Lifecycle.setPhases(Map<String,String>)` due to https://issues.apache.org/jira/browse/MNG-5958 in Maven [3.3.9,3.5.0).
So an implementation of LifecycleMapping or Provider<LifecycleMapping> is unfortunately requiring a lot of glue code currently...

Konrad


On 2022/07/12 14:23:26 Tamás Cservenák wrote:
> Howdy,
> 
> just for fun I hit the same issue, and this is how I got rid of Plexus XML
> https://github.com/apache/maven-rar-plugin/pull/3/files#diff-b7fae2df008a8b4ad8bc93e5c2229a5768fbdc77e904615d706c5c29e5ad4997
> 
> HTH
> T
> 
> On Wed, Jul 6, 2022 at 4:26 PM Konrad Windszus <kw...@apache.org> wrote:
> 
> >
> >
> > On 2022/07/06 14:18:28 Tamás Cservenák wrote:
> > > Maven 3.0 did not support sisu-index (produced by sisu-maven-plugin
> > during
> > > build), but 3.1 onward does support it.
> > >
> > > Hence. If you support Maven 3.0 inclusive, you must stick with plexus
> > xml,
> > > otherwise is not required.
> > >
> > > T
> >
> > The problem is not the support of sisu-index but rather the missing
> > constructor or public fields of
> > https://github.com/apache/maven/blob/maven-3.8.6/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java
> > and I don't want to implement
> > https://github.com/apache/maven/blob/90c084dcf495e73c679395bc4b050500cbccf8cf/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMapping.java#L28
> > from scratch.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: JSR330: Overriding the default lifecycle

Posted by Tamás Cservenák <ta...@cservenak.net>.
Howdy,

just for fun I hit the same issue, and this is how I got rid of Plexus XML
https://github.com/apache/maven-rar-plugin/pull/3/files#diff-b7fae2df008a8b4ad8bc93e5c2229a5768fbdc77e904615d706c5c29e5ad4997

HTH
T

On Wed, Jul 6, 2022 at 4:26 PM Konrad Windszus <kw...@apache.org> wrote:

>
>
> On 2022/07/06 14:18:28 Tamás Cservenák wrote:
> > Maven 3.0 did not support sisu-index (produced by sisu-maven-plugin
> during
> > build), but 3.1 onward does support it.
> >
> > Hence. If you support Maven 3.0 inclusive, you must stick with plexus
> xml,
> > otherwise is not required.
> >
> > T
>
> The problem is not the support of sisu-index but rather the missing
> constructor or public fields of
> https://github.com/apache/maven/blob/maven-3.8.6/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java
> and I don't want to implement
> https://github.com/apache/maven/blob/90c084dcf495e73c679395bc4b050500cbccf8cf/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMapping.java#L28
> from scratch.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: JSR330: Overriding the default lifecycle

Posted by Konrad Windszus <kw...@apache.org>.

On 2022/07/06 14:18:28 Tamás Cservenák wrote:
> Maven 3.0 did not support sisu-index (produced by sisu-maven-plugin during
> build), but 3.1 onward does support it.
> 
> Hence. If you support Maven 3.0 inclusive, you must stick with plexus xml,
> otherwise is not required.
> 
> T

The problem is not the support of sisu-index but rather the missing constructor or public fields of https://github.com/apache/maven/blob/maven-3.8.6/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifecycleMapping.java and I don't want to implement https://github.com/apache/maven/blob/90c084dcf495e73c679395bc4b050500cbccf8cf/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/LifecycleMapping.java#L28 from scratch.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: JSR330: Overriding the default lifecycle

Posted by Tamás Cservenák <ta...@cservenak.net>.
Maven 3.0 did not support sisu-index (produced by sisu-maven-plugin during
build), but 3.1 onward does support it.

Hence. If you support Maven 3.0 inclusive, you must stick with plexus xml,
otherwise is not required.

T

On Wed, Jul 6, 2022, 15:17 Konrad Windszus <kw...@apache.org> wrote:

>
> > or are you trying to create bindings for a new packaging?
>
> Yes, this is what I am doing. You can see it already in
> https://github.com/apache/jackrabbit-filevault-package-maven-plugin/blob/master/src/main/resources/META-INF/plexus/components.xml
> .
>
> But from all your information I derived that I need to stick with
> plexus/components.xml for the time being to be compatible with Maven 3.x. I
> don't see any possibility to keep compatibility while switching to JSR 330.
>
> Konrad
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: JSR330: Overriding the default lifecycle

Posted by Konrad Windszus <kw...@apache.org>.
> or are you trying to create bindings for a new packaging?

Yes, this is what I am doing. You can see it already in https://github.com/apache/jackrabbit-filevault-package-maven-plugin/blob/master/src/main/resources/META-INF/plexus/components.xml.

But from all your information I derived that I need to stick with plexus/components.xml for the time being to be compatible with Maven 3.x. I don't see any possibility to keep compatibility while switching to JSR 330.

Konrad

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: JSR330: Overriding the default lifecycle

Posted by Hervé BOUTEMY <he...@free.fr>.
btw, are you trying ot override the default lifecycle
= https://maven.apache.org/ref/3.8.6/maven-core/lifecycles.html

or are you trying to override the default bindings for some packaging
= https://maven.apache.org/ref/3.8.6/maven-core/default-bindings.html

or are you trying to create bindings for a new packaging?

Le mardi 5 juillet 2022, 13:34:42 CEST Hervé BOUTEMY a écrit :
> AbstractLifecycleMappingProvider is just an internal utility class to ease
> each Provider class writing, can be copied
> 
> on Maven mixing plexus metadata with sisu and making sure overrides work, I
> confess you should test...
> 
> on the lifecycle definition in maven-jar-plugin, the current copy is done
> but is not used (because of plugin classloader and because packaging
> lifecycle mapping is done even before the plugin is discovered, given the
> plugin is discovered as a result of the packaging lifecycle mapping)
> this is a work in progress https://issues.apache.org/jira/browse/MNG-5697
> It half works if plugin is set as extension (I say half works because at
> least the classloading issue is solved, but the discovery of the plugin is
> still done too late)
> 
> 
> I don't exactly know your use case for trying to override the default
> lifecycle, but it is definitely something tricky
> 
> Regards,
> 
> Hervé
> 
> Le lundi 4 juillet 2022, 09:36:54 CEST Konrad Windszus a écrit :
> > Thanks for the explanation.
> > 
> > As the AbstractLifecycleMappingProvider is Maven 4 only the solution for
> > extensions/plugins supporting Maven 3 is staying with plexus metadata?
> > 
> > Also I see that this is still the current way of how this is implemented
> > in
> > maven-jar-plugin
> > (https://github.com/apache/maven-jar-plugin/blob/master/src/main/filtered-> > r
> > esources/META-INF/plexus/components.xml).
> > 
> > Konrad
> > 
> > On 2022/07/04 07:23:42 Hervé BOUTEMY wrote:
> > > on getting rid of plexus metadata for lifecycle mappings, see the work
> > > done in core [1]: they are replaced by Provider classes
> > > 
> > > I suppose that doing equivalent classes with JSR-330 annotations in an
> > > extension will override the core-provided classes given classpath order
> > > 
> > > Regards,
> > > 
> > > Hervé
> > > 
> > > [1]
> > > https://github.com/apache/maven/tree/master/maven-core/src/main/java/org
> > > /
> > > apache/maven/lifecycle/providers>
> > > 
> > > Le lundi 4 juillet 2022, 08:48:01 CEST Konrad Windszus a écrit :
> > > > Hi,
> > > > What is the best way to get rid of plexus metadata (components.xml)
> > > > and
> > > > override the default lifecycle mapping for a certain type (as outlined
> > > > in
> > > > https://blog.sonatype.com/2009/08/create-a-customized-build-process-in
> > > > -m
> > > > ave
> > > > n/) only leveraging JSR 330 annotations
> > > > (https://github.com/eclipse/sisu.plexus/wiki/Plexus-to-JSR330)?
> > > > 
> > > > I guess I have to convert the XML configuration to a simple Java class
> > > > with
> > > > annotations. Is there no configuration via metadata files available in
> > > > Sisu?
> > > > 
> > > > Also prior 2020
> > > > (https://github.com/apache/maven/commit/6c7d105916bb288b1f0f7010035c71
> > > > 8f
> > > > 16e
> > > > 11240, only part of Maven 4) there was only the default constructor
> > > > and
> > > > the
> > > > private field lifecycles
> > > > (https://github.com/apache/maven/blob/673a7d1fef55795ea47a147f158a1411
> > > > 47
> > > > 5e7
> > > > 495/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/Defaul
> > > > tL
> > > > ifec ycleMapping.java#L33) so I would have to work with reflection to
> > > > inject the correct configuration.
> > > > 
> > > > Any hints highly appreciated.
> > > > Konrad
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: dev-help@maven.apache.org
> > > 
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: JSR330: Overriding the default lifecycle

Posted by Hervé BOUTEMY <he...@free.fr>.
AbstractLifecycleMappingProvider is just an internal utility class to ease 
each Provider class writing, can be copied

on Maven mixing plexus metadata with sisu and making sure overrides work, I 
confess you should test...

on the lifecycle definition in maven-jar-plugin, the current copy is done but 
is not used (because of plugin classloader and because packaging lifecycle 
mapping is done even before the plugin is discovered, given the plugin is 
discovered as a result of the packaging lifecycle mapping)
this is a work in progress https://issues.apache.org/jira/browse/MNG-5697
It half works if plugin is set as extension (I say half works because at least 
the classloading issue is solved, but the discovery of the plugin is still 
done too late)


I don't exactly know your use case for trying to override the default 
lifecycle, but it is definitely something tricky

Regards,

Hervé

Le lundi 4 juillet 2022, 09:36:54 CEST Konrad Windszus a écrit :
> Thanks for the explanation.
> 
> As the AbstractLifecycleMappingProvider is Maven 4 only the solution for
> extensions/plugins supporting Maven 3 is staying with plexus metadata?
> 
> Also I see that this is still the current way of how this is implemented in
> maven-jar-plugin
> (https://github.com/apache/maven-jar-plugin/blob/master/src/main/filtered-r
> esources/META-INF/plexus/components.xml).
> 
> Konrad
> 
> On 2022/07/04 07:23:42 Hervé BOUTEMY wrote:
> > on getting rid of plexus metadata for lifecycle mappings, see the work
> > done in core [1]: they are replaced by Provider classes
> > 
> > I suppose that doing equivalent classes with JSR-330 annotations in an
> > extension will override the core-provided classes given classpath order
> > 
> > Regards,
> > 
> > Hervé
> > 
> > [1]
> > https://github.com/apache/maven/tree/master/maven-core/src/main/java/org/
> > apache/maven/lifecycle/providers> 
> > Le lundi 4 juillet 2022, 08:48:01 CEST Konrad Windszus a écrit :
> > > Hi,
> > > What is the best way to get rid of plexus metadata (components.xml) and
> > > override the default lifecycle mapping for a certain type (as outlined
> > > in
> > > https://blog.sonatype.com/2009/08/create-a-customized-build-process-in-m
> > > ave
> > > n/) only leveraging JSR 330 annotations
> > > (https://github.com/eclipse/sisu.plexus/wiki/Plexus-to-JSR330)?
> > > 
> > > I guess I have to convert the XML configuration to a simple Java class
> > > with
> > > annotations. Is there no configuration via metadata files available in
> > > Sisu?
> > > 
> > > Also prior 2020
> > > (https://github.com/apache/maven/commit/6c7d105916bb288b1f0f7010035c718f
> > > 16e
> > > 11240, only part of Maven 4) there was only the default constructor and
> > > the
> > > private field lifecycles
> > > (https://github.com/apache/maven/blob/673a7d1fef55795ea47a147f158a141147
> > > 5e7
> > > 495/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultL
> > > ifec ycleMapping.java#L33) so I would have to work with reflection to
> > > inject the correct configuration.
> > > 
> > > Any hints highly appreciated.
> > > Konrad
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: JSR330: Overriding the default lifecycle

Posted by Konrad Windszus <kw...@apache.org>.
Thanks for the explanation.

As the AbstractLifecycleMappingProvider is Maven 4 only the solution for extensions/plugins supporting Maven 3 is staying with plexus metadata?

Also I see that this is still the current way of how this is implemented in maven-jar-plugin (https://github.com/apache/maven-jar-plugin/blob/master/src/main/filtered-resources/META-INF/plexus/components.xml).

Konrad



On 2022/07/04 07:23:42 Hervé BOUTEMY wrote:
> on getting rid of plexus metadata for lifecycle mappings, see the work done in core [1]: they are replaced by Provider classes
> 
> I suppose that doing equivalent classes with JSR-330 annotations in an extension will override the core-provided classes given classpath order
> 
> Regards,
> 
> Hervé
> 
> [1] https://github.com/apache/maven/tree/master/maven-core/src/main/java/org/apache/maven/lifecycle/providers
> 
> Le lundi 4 juillet 2022, 08:48:01 CEST Konrad Windszus a écrit :
> > Hi,
> > What is the best way to get rid of plexus metadata (components.xml) and
> > override the default lifecycle mapping for a certain type (as outlined in
> > https://blog.sonatype.com/2009/08/create-a-customized-build-process-in-mave
> > n/) only leveraging JSR 330 annotations
> > (https://github.com/eclipse/sisu.plexus/wiki/Plexus-to-JSR330)?
> > 
> > I guess I have to convert the XML configuration to a simple Java class with
> > annotations. Is there no configuration via metadata files available in
> > Sisu?
> > 
> > Also prior 2020
> > (https://github.com/apache/maven/commit/6c7d105916bb288b1f0f7010035c718f16e
> > 11240, only part of Maven 4) there was only the default constructor and the
> > private field lifecycles
> > (https://github.com/apache/maven/blob/673a7d1fef55795ea47a147f158a1411475e7
> > 495/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifec
> > ycleMapping.java#L33) so I would have to work with reflection to inject the
> > correct configuration.
> > 
> > Any hints highly appreciated.
> > Konrad
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: JSR330: Overriding the default lifecycle

Posted by Hervé BOUTEMY <he...@free.fr>.
on getting rid of plexus metadata for lifecycle mappings, see the work done in core [1]: they are replaced by Provider classes

I suppose that doing equivalent classes with JSR-330 annotations in an extension will override the core-provided classes given classpath order

Regards,

Hervé

[1] https://github.com/apache/maven/tree/master/maven-core/src/main/java/org/apache/maven/lifecycle/providers

Le lundi 4 juillet 2022, 08:48:01 CEST Konrad Windszus a écrit :
> Hi,
> What is the best way to get rid of plexus metadata (components.xml) and
> override the default lifecycle mapping for a certain type (as outlined in
> https://blog.sonatype.com/2009/08/create-a-customized-build-process-in-mave
> n/) only leveraging JSR 330 annotations
> (https://github.com/eclipse/sisu.plexus/wiki/Plexus-to-JSR330)?
> 
> I guess I have to convert the XML configuration to a simple Java class with
> annotations. Is there no configuration via metadata files available in
> Sisu?
> 
> Also prior 2020
> (https://github.com/apache/maven/commit/6c7d105916bb288b1f0f7010035c718f16e
> 11240, only part of Maven 4) there was only the default constructor and the
> private field lifecycles
> (https://github.com/apache/maven/blob/673a7d1fef55795ea47a147f158a1411475e7
> 495/maven-core/src/main/java/org/apache/maven/lifecycle/mapping/DefaultLifec
> ycleMapping.java#L33) so I would have to work with reflection to inject the
> correct configuration.
> 
> Any hints highly appreciated.
> Konrad
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org