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

Embedder's MavenCli cannot be executed from another plugin Mojo.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.9.8
    • None
    • Embedding
    • None

    Description

       

      I am trying to run the maven-embedder from a plugin's Mojo that I develop.

      I am using the mavenCli like below,

       

      MavenCli cli = new MavenCli();
      cli.doMain(new String[] {"clean","compile"}, project.getBasedir().getAbsolutePath(), System.out, System.err); 

       

      Here are the dependencies in my pom.xml

       

       

      <dependency>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-embedder</artifactId>
          <version>3.9.8</version>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>org.apache.maven</groupId>
          <artifactId>maven-compat</artifactId>
          <version>3.9.8</version>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>org.eclipse.sisu</groupId>
          <artifactId>org.eclipse.sisu.plexus</artifactId>
          <version>0.3.5</version>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>org.eclipse.sisu</groupId>
          <artifactId>org.eclipse.sisu.inject</artifactId>
          <version>0.3.5</version>
          <scope>provided</scope>
      </dependency> 

      The full source code of the plugin can be found here:

      https://github.com/HomeOfTheWizard/spring-bridge-maven-plugin/tree/feature/embedder-for-compilation

       

      When using this plugin in another maven plugin project,

      I have the following error.

      [INFO] [ERROR] Error executing Maven.
      [INFO] [ERROR] Unable to create injector, see the following errors:
      [INFO] 
      [INFO] 1) [Guice/ScopeNotFound]: No scope is bound to SessionScoped.
      [INFO] 
      [INFO] Used at:
      [INFO] 1  : ReactorReader.class(ReactorReader.java:63)
      [INFO]      at ClassRealm[plexus.core, parent: null]
      [INFO]       \_ installed by: WireModule -> PlexusBindingModule
      [INFO] 
      [INFO] Learn more:
      [INFO]   https://github.com/google/guice/wiki/SCOPE_NOT_FOUND
      [INFO] 
      [INFO] 1 error
      [INFO] 
      [INFO] ======================
      [INFO] Full classname legend:
      [INFO] ======================
      [INFO] PlexusBindingModule: "org.eclipse.sisu.plexus.PlexusBindingModule"
      [INFO] ReactorReader:       "org.apache.maven.ReactorReader"
      [INFO] SessionScoped:       "org.apache.maven.SessionScoped"
      [INFO] WireModule:          "org.eclipse.sisu.wire.WireModule"
      [INFO] ========================
      [INFO] End of classname legend:
      [INFO] ======================== 

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            ozgun Ozgun OZ
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: