Re: Maven plugins - injecting Maven components

2022-06-02 Thread Romain Manni-Bucau
Le jeu. 2 juin 2022 à 11:47, Stuart McCulloch a écrit : > Sorry, I was just struggling to see where exposing JSR330 has negatively > impacted users in practice (ie excluding anything related to exposing CDI) > > For the CDI API sure, when that was exposed we didn't anticipate that the > CDI spec

Re: Maven plugins - injecting Maven components

2022-06-02 Thread Stuart McCulloch
Sorry, I was just struggling to see where exposing JSR330 has negatively impacted users in practice (ie excluding anything related to exposing CDI) For the CDI API sure, when that was exposed we didn't anticipate that the CDI spec would evolve how it did - so removing that is logical - but when th

Re: Maven plugins - injecting Maven components

2022-06-02 Thread Romain Manni-Bucau
@Stuart: api validating or enforcing classloader in mojo need workarounds since you will use javax.inject from maven and not from your mojo container/code (embedding an OSGi container can have this issue in some cases without much hack but most container using classloaders will hit it, I hit it at

Re: Maven plugins - injecting Maven components

2022-06-02 Thread Sylwester Lachiewicz
Maybe design document and later with PoC API, implementation is something that we missed and You can help here to solve this problem for users, based on real case from You? Br Sylwester czw., 2 cze 2022, 10:57 użytkownik Romain Manni-Bucau napisał: > Hi Stuart, > > Not really, they relate to c

Re: Maven plugins - injecting Maven components

2022-06-02 Thread Stuart McCulloch
Could you highlight which one was specifically an issue with JSR330 (ie. an actual issue, not a theoretical one) and not the CDI API as I must have missed it? On Thu, 2 Jun 2022, 09:57 Romain Manni-Bucau, wrote: > Hi Stuart, > > Not really, they relate to cdi or atinject spec and explain why we

Re: Maven plugins - injecting Maven components

2022-06-02 Thread Romain Manni-Bucau
Hi Stuart, Not really, they relate to cdi or atinject spec and explain why we must not expose it to plugins - and more generally how exposing standard or mainstream API does not reach our isolation goal for plugins. Concretely our maven-core extension.xml file should not list any javax/jakarta pac

Re: Maven plugins - injecting Maven components

2022-06-02 Thread Stuart McCulloch
Thanks - afaict those all relate to the CDI API which was previously only added so people could use the @Typed annotation during early migration away from Plexus specifics (this is not required by the container, it's an optional dependency) As mentioned before I only know of one external extension

Re: Maven plugins - injecting Maven components

2022-06-02 Thread Romain Manni-Bucau
Hi Sorry for the delay. Here what I found back but an be worth checking other project mailing lists since it often leads to dirty workarounds: - https://lists.apache.org/thread/wlocsqglzsn18g3o4vc8721gm3nmn99x - https://lists.apache.org/thread/d9rhh61yy1mtorcc7n6v903rs24md649 - https://lists.apa

Re: Maven plugins - injecting Maven components

2022-05-31 Thread Slawomir Jaranowski
Hi Romain Did you find - discussions and reported issues? pt., 20 maj 2022 o 23:18 Romain Manni-Bucau napisał(a): > Le ven. 20 mai 2022 à 22:21, Slawomir Jaranowski > a > écrit : > > > I was convinced that plexus is deprecated [1] [2], but you propose that > > users writing plugins outsid

Re: Maven plugins - injecting Maven components

2022-05-20 Thread Romain Manni-Bucau
Le ven. 20 mai 2022 à 22:21, Slawomir Jaranowski a écrit : > I was convinced that plexus is deprecated [1] [2], but you propose that > users writing plugins outside the Maven core team should use it. > Maybe I missed something? > There are multiple discussions - can try to find them back next w

Re: Maven plugins - injecting Maven components

2022-05-20 Thread Slawomir Jaranowski
I was convinced that plexus is deprecated [1] [2], but you propose that users writing plugins outside the Maven core team should use it. Maybe I missed something? There is no information [3] that JSR303 should be used only in Maven core plugins / components. [1] https://codehaus-plexus.github.io

Re: Maven plugins - injecting Maven components

2022-05-20 Thread Romain Manni-Bucau
I'm not sure for shared, I always considered them as internals of maven projects and rarely saw them reused except a very few times but reasoning is the same whatever module we speak about: does it impact external consumer? If yes -> only org.apache.maven API or assimilated/assimilable (plexus is t

Re: Maven plugins - injecting Maven components

2022-05-20 Thread Sylwester Lachiewicz
And what about shared libraries? they can be used by plugins or even externally. Sylwester pt., 20 maj 2022, 19:15 użytkownik Romain Manni-Bucau napisał: > It is quite simple: > > Maven plugin: maven API or plexus annotations are preferred > Maven core: JSR 330 is out internal API for IoC looku

Re: Maven plugins - injecting Maven components

2022-05-20 Thread Romain Manni-Bucau
Hmm, can be but it does not change the answer to Sławomir since javax.*/jakarta.* are no-go for mojo (and hopefully extensions soon) outside maven project (understand maintained by maven committers), does it? Romain Manni-Bucau @rmannibucau | Blog

Re: Maven plugins - injecting Maven components

2022-05-20 Thread Tamás Cservenák
Romain, I think you completely misinterpreted what Jason and Stuart meant. T On Fri, May 20, 2022, 19:15 Romain Manni-Bucau wrote: > It is quite simple: > > Maven plugin: maven API or plexus annotations are preferred > Maven core: JSR 330 is out internal API for IoC lookups/injections > > Roma

Re: Maven plugins - injecting Maven components

2022-05-20 Thread Romain Manni-Bucau
It is quite simple: Maven plugin: maven API or plexus annotations are preferred Maven core: JSR 330 is out internal API for IoC lookups/injections Romain Manni-Bucau @rmannibucau | Blog | Old Blog

Re: Maven plugins - injecting Maven components

2022-05-20 Thread Slawomir Jaranowski
Hi, I'm a little confused - what should be conclusions from this discussion? I asked about using JSR330 with maven components like MavenProject, MavenSession ... in plugin Mojo code. But I see discussion about using JSR330 at general in Maven plugins Currently we widely use JSR330 in core Maven

Re: Maven plugins - injecting Maven components

2022-05-18 Thread Romain Manni-Bucau
Le mer. 18 mai 2022 à 15:19, Stuart McCulloch a écrit : > On Wed, 18 May 2022 at 14:15, Romain Manni-Bucau > wrote: > > > Le mer. 18 mai 2022 à 15:03, Stuart McCulloch a > écrit > > : > > > > > I do wonder whether we're conflating the real issues of exposing the > CDI > > > API (for @Typed) wit

Re: Maven plugins - injecting Maven components

2022-05-18 Thread Stuart McCulloch
On Wed, 18 May 2022 at 14:15, Romain Manni-Bucau wrote: > Le mer. 18 mai 2022 à 15:03, Stuart McCulloch a écrit > : > > > I do wonder whether we're conflating the real issues of exposing the CDI > > API (for @Typed) with the much smaller JSR330 API > > > > Yes as soon as you have a different ver

Re: Maven plugins - injecting Maven components

2022-05-18 Thread Romain Manni-Bucau
Le mer. 18 mai 2022 à 15:03, Stuart McCulloch a écrit : > I do wonder whether we're conflating the real issues of exposing the CDI > API (for @Typed) with the much smaller JSR330 API > Yes as soon as you have a different version needed by a plugin and the api exposed (parent first forced - and i

Re: Maven plugins - injecting Maven components

2022-05-18 Thread Stuart McCulloch
I do wonder whether we're conflating the real issues of exposing the CDI API (for @Typed) with the much smaller JSR330 API Does anyone have a link to an issue that specifically involved exporting the JSR330 API (I did a quick search but the threads I found were all about the CDI API) IIRC there wa

Re: Maven plugins - injecting Maven components

2022-05-18 Thread Romain Manni-Bucau
Le mer. 18 mai 2022 à 11:52, Jason van Zyl a écrit : > I have used SLF4J and JSR330 in plugins for years without issue. They all > still work and nothing has mysteriously stopped working even made 7+ years > ago. I honestly don’t see much point in making our own annotations, and > I’ve not encoun

Re: Maven plugins - injecting Maven components

2022-05-18 Thread Jason van Zyl
I have used SLF4J and JSR330 in plugins for years without issue. They all still work and nothing has mysteriously stopped working even made 7+ years ago. I honestly don’t see much point in making our own annotations, and I’ve not encountered any of the issues Romain presents. To Romain’s points

Re: Maven plugins - injecting Maven components

2022-05-17 Thread Romain Manni-Bucau
So clearly -1 for @inject then. Le mar. 17 mai 2022 à 22:49, Slawomir Jaranowski a écrit : > pon., 16 maj 2022 o 20:44 Romain Manni-Bucau > napisał(a): > > > Le lun. 16 mai 2022 à 19:14, Slawomir Jaranowski > > > a > > écrit : > > > > > But from other side we can use JSR-330 in Mojo [1] > > >

Re: Maven plugins - injecting Maven components

2022-05-17 Thread Slawomir Jaranowski
pon., 16 maj 2022 o 20:44 Romain Manni-Bucau napisał(a): > Le lun. 16 mai 2022 à 19:14, Slawomir Jaranowski > a > écrit : > > > But from other side we can use JSR-330 in Mojo [1] > > > > so we will: > > > >@Parameter( defaultValue = "${project}", readonly = true, required = > > true ) > >

Re: Maven plugins - injecting Maven components

2022-05-16 Thread Romain Manni-Bucau
Le lun. 16 mai 2022 à 19:14, Slawomir Jaranowski a écrit : > But from other side we can use JSR-330 in Mojo [1] > > so we will: > >@Parameter( defaultValue = "${project}", readonly = true, required = > true ) > private MavenProject project; > > @Inject > public SuperMojo( Jsr330Co

Re: Maven plugins - injecting Maven components

2022-05-16 Thread Slawomir Jaranowski
But from other side we can use JSR-330 in Mojo [1] so we will: @Parameter( defaultValue = "${project}", readonly = true, required = true ) private MavenProject project; @Inject public SuperMojo( Jsr330Component component ) { } >From code perspective will be clear @In

Re: Maven plugins - injecting Maven components

2022-05-16 Thread Romain Manni-Bucau
Hi Sławomir, This is a complex topic, basically there is a will to get a real IoC for maven-core and keep a maven specific API for plugin writers so I'm tempted to say option 1 for mojo. As a reminder the issues exposing @Inject are: 1. We can conflict with plugins (it is the case already and a

Maven plugins - injecting Maven components

2022-05-16 Thread Slawomir Jaranowski
Hi, We can inject Maven components into plugins in many ways ... We can use @Parameter, like: @Parameter( defaultValue = "${project}", readonly = true, required = true ) private MavenProject project; @Parameter( defaultValue = "${session}", readonly = true, required = true ) pri