Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7947

Plugin API

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.0.0-alpha-9
    • 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

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            gnodet Guillaume Nodet
            gnodet Guillaume Nodet
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment