Re: getting rid of Contextualizable
Turns out that simply removing the method and annotating the field with `@Inject` and adding sisu-plexus solved that for me. -h On Sun, May 21, 2023 at 3:37 PM Henning Schmiedehausen < henn...@schmiedehausen.org> wrote: > I have a plugin where the mojo implements Contextualizable and it does > this: > > @Override > public void contextualize(final Context context) > throws ContextException { > this.container = (PlexusContainer) > context.get(PlexusConstants.PLEXUS_KEY); > } > > Basically, this gives me access to the Plexus container at the heart of > maven. In turn, the code uses the container to look up specific, > user-loadable components: > > macroType = (MacroType) container.lookup(MacroType.ROLE, ...); > > where "MacroType.ROLE" is a specific plexus role. There are components > registered with the container like this: > > @Component(role = MacroType.class, hint = "demo") > public class DemoMacro > implements MacroType { > > If I get rid of Contextualizable, how will I get access to the container? > Basically, I need to get my fingers on something that allows me dynamic > lookup of components. I am fine to rewrite this to use the sisu or guice > injectors, but right now, it does not work at all (the container is null). > > Googling/trawling the maven doc did not give any useful answers. > > -h > > > >
getting rid of Contextualizable
I have a plugin where the mojo implements Contextualizable and it does this: @Override public void contextualize(final Context context) throws ContextException { this.container = (PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY); } Basically, this gives me access to the Plexus container at the heart of maven. In turn, the code uses the container to look up specific, user-loadable components: macroType = (MacroType) container.lookup(MacroType.ROLE, ...); where "MacroType.ROLE" is a specific plexus role. There are components registered with the container like this: @Component(role = MacroType.class, hint = "demo") public class DemoMacro implements MacroType { If I get rid of Contextualizable, how will I get access to the container? Basically, I need to get my fingers on something that allows me dynamic lookup of components. I am fine to rewrite this to use the sisu or guice injectors, but right now, it does not work at all (the container is null). Googling/trawling the maven doc did not give any useful answers. -h
Re: maven resolver beyond 1.6.x
Thank you for the quick response. However, I am not sure that I got what I needed. Upgrading/changing maven etc. is a non-starter. This is a plugin ( https://github.com/basepom/dependency-versions-check-maven-plugin/), which I maintain. It is supposed to be compatible with Maven 3.8.x (older versions at your own risk. :-) ) and beyond. Currently I use API 3.8.7 and resolver 1.6.3. I am fine to keep using this; it contains all I need. The question was, if I upgrade the dependency here to post-1.6, assuming that I keep using the 1.6. API footprint, will this cause problems with users' Maven 3.8.x installation? The plugin declares the API as "provided" as suggested, but uses the resolver-util jar as well which is a dependency of the plugin. I am aware of the "maven-3.8 with resolver 1.8 and 1.9 distributions" but most (all?) users will not have that. -h On Sat, May 20, 2023 at 1:14 AM Michael Osipov wrote: > Am 2023-05-20 um 00:35 schrieb Henning Schmiedehausen: > > Hi, > > > > The page on https://maven.apache.org/resolver/maven-3.8.x.html states > > that *"Since > > version 1.7.0, Maven Resolver requires Java 8 to run and a brand new > > default sync context factory has been implemented."*. > > > > Assuming for a moment that Java 8+ is a no-brainer, what does the second > > part of that sentence mean? If a plugin would require Java 8+ anyway (or > > even Java 11+), would it be possible for a plugin to move past 1.6.x and > > still be compatible with Maven 3.8.x or would using any version past > 1.6.3 > > (we are on 1.9.x now) not work with Maven 3.8? > > > > I have a plugin that has resolver api in "provided" scope so it will be > > whatever maven will inject into the plugin and the implementation itself > is > > in compile scope (so it will be bundled with the plugin). > > Short version: yes. > > First of all, I provide signed artifacts of Maven 3.8.x: > * > https://dist.apache.org/repos/dist/dev/maven/maven-3/3.8.x-resolver-1.9.x/ > * > https://dist.apache.org/repos/dist/dev/maven/maven-3/3.8.x-resolver-1.8.x/ > > with just Maven Resolver updated. It just works with 3.8.x > > Long answer: As long as your plugin uses the API from 1.6.x it can run > with 3.8.x and above, but if there is any API change and you start to > use it, of course you need my modified version. You can enjoy all > benefits from 1.9.x with 3.8.x. Beware that settings done by Maven 3.9.x > directly to Resolver do not apply here, so the 3.8.x defaults apply, > e.g., transport and stuff. > I will try to produce updated artifacts with Resolver 1.9.10. > > I must admit that 3.9.x should have been 3.10.x and 3.8.x moved to 3.9.x > with just the Resolver and Java 8 upgrade, but that ship has sailed :-( > > M > > - > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org > For additional commands, e-mail: dev-h...@maven.apache.org > >
maven-gpg-plugin CI broken
See https://github.com/apache/maven-gpg-plugin/pull/51 Verify / Verify / windows-latest jdk-8-temurin 3.9.2 (push) is broken Perhaps someone with relevant permissions can figure this one out. -- Elliotte Rusty Harold elh...@ibiblio.org - To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org
[ANN] Apache Maven Source Plugin 3.3.0 Released
The Apache Maven team is pleased to announce the release of the Apache Maven Source Plugin, version 3.3.0 The Source Plugin creates a jar archive of the source files of the current project. https://maven.apache.org/plugins/maven-source-plugin/ You should specify the version in your project's plugin configuration: org.apache.maven.plugins maven-source-plugin 3.3.0 You can download the appropriate sources etc. from the download page: https://maven.apache.org/plugins/maven-source-plugin/download.cgi Release Notes - Maven Source Plugin - Version 3.3.0 ** Bug * [MSOURCES-121] - Check for duplicated addition of the same file * [MSOURCES-126] - reproducible IT failing since January 1st 2020 ** Task * [MSOURCES-134] - Refresh download page * [MSOURCES-135] - Cleanup project code ** Dependency upgrade * [MSOURCES-131] - Update plugin (requires Maven 3.2.5+) * [MSOURCES-132] - Update Maven Archiver to 3.6.0 * [MSOURCES-133] - Upgrade Parent to 39 Enjoy, -The Apache Maven team
[RESULT] [VOTE] Release Apache Maven Source Plugin version 3.3.0
The vote has passed with the following result: +1: Sylwester Lachiewicz, Herve Boutemy, Tamás Cservenák, Guillaume Nodet, Michael Osipov, Olivier Lamy PMC quorum: reached I will promote the source release zip file to Apache distribution area and the artifacts to the central repo. -- Sławomir Jaranowski