Uploaded image for project: 'Maven Plugin Testing'
  1. Maven Plugin Testing
  2. MPLUGINTESTING-41

can't test mojos that use @MojoExecutionScoped components

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.2.0
    • plugin-testing-harness
    • None

    Description

      MojoExecutionScope (and SessionScope) Guice scopes were introduced in maven 3.2.1. Attempt to test mojos that use such components with plugin-testing-harness results in the following Guice/Sisu lookup failure

      com.google.inject.CreationException: Guice creation errors:
      
      1) No scope is bound to org.apache.maven.execution.scope.MojoExecutionScoped.
        at com.ifedorenko.maven.sample.ExecutionScopedComponent.class(Unknown Source)
        at /workspaces/tesla-dev/sample-maven-plugin/target/classes/
      
      1 error
      	at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:437)
      	at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:155)
      	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
      	at com.google.inject.Guice.createInjector(Guice.java:94)
      	at com.google.inject.Guice.createInjector(Guice.java:71)
      	at com.google.inject.Guice.createInjector(Guice.java:61)
      	at org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector(DefaultPlexusContainer.java:477)
      	at org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:203)
      	at org.apache.maven.plugin.testing.AbstractMojoTestCase.setupContainer(AbstractMojoTestCase.java:227)
      	at org.apache.maven.plugin.testing.AbstractMojoTestCase.getContainer(AbstractMojoTestCase.java:261)
      	at org.apache.maven.plugin.testing.AbstractMojoTestCase.setUp(AbstractMojoTestCase.java:115)
      	at org.apache.maven.plugin.testing.MojoRule$2.evaluate(MojoRule.java:299)
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      

      Attachments

        Activity

          People

            igorfie igorfie
            igorf Igor Fedorenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: