You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Igor Fedorenko (JIRA)" <ji...@codehaus.org> on 2014/07/08 11:07:10 UTC

[jira] (MPLUGINTESTING-41) can't test mojos that use @MojoExecutionScoped components

Igor Fedorenko created MPLUGINTESTING-41:
--------------------------------------------

             Summary: can't test mojos that use @MojoExecutionScoped components
                 Key: MPLUGINTESTING-41
                 URL: https://jira.codehaus.org/browse/MPLUGINTESTING-41
             Project: Maven Plugin Testing
          Issue Type: Bug
          Components: plugin-testing-harness
            Reporter: Igor Fedorenko


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

{code}
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)
{code}



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)