Details
-
New Feature
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Switch to Guice 6.0, use guice to instantiate and inject mojos
Context: the goal for the maven API is to be completely independent of any third party library. I was working this week on migrating some parts of the Plugin API for Maven 4. Unfortunately, the scopes (@SessionScoped and @MojoExecutionScoped) need to be annotated by a scope annotation so that they are recognised as such by Guice. So either the guice annotation or the javax.inject one. Given javax.inject will slowly go away, I went straight to jakarta.inject, thus upgrading to Guice 6.0 (which supports both javax.inject and jakarta.inject, while Guice 7.0 only supports jakarta.inject).
Maven 4 api for plugin execution
This introduces an immutable plugin descriptor (and custom lifecycle for plugins too). The Maven 3 PluginDescriptor contains runtime information such as the class loader, dependencies, etc... Those are moved to the o.a.m.api.Plugin class which can be accessed from the o.a.m.api.MojoExecution along with the MojoDescriptor and PluginDescriptor.
Leveraging guice, some fields inherited from the plexus land now disappear: instantiationStrategy is replaced with scope annotations, @Component replaced by @Inject.
Attachments
Attachments
Issue Links
- causes
-
MNG-8208 Plugin Descriptor v2 misses elements
- Closed
- links to