On 8 March 2011 12:56, Karl Heinz Marbaise <[email protected]> wrote:

> Hi,
>
> i have checked the following code parts like this  and
>
> http://git.eclipse.org/c/m2e/m2e-core.git/plain/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/MavenImpl.java
> this ...but the following project brought me further
> https://github.com/jenkinsci/lib-jenkins-maven-embedder
>
> ok i get a further step forward...and now a have problem which i didn't
> understand...which means the following message:
>
>
> java.lang.ExceptionInInitializerError
>        at
>
> org.codehaus.plexus.DefaultPlexusContainer$SetupModule.configure(DefaultPlexusContainer.java:775)
>        at
> com.google.inject.AbstractModule.configure(AbstractModule.java:59)
>        at
> com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
>        at com.google.inject.spi.Elements.getElements(Elements.java:101)
>        at com.google.inject.spi.Elements.getElements(Elements.java:78)
>        at
>
> org.sonatype.guice.bean.binders.MergedModule.configure(MergedModule.java:55)
>        at
> com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223)
>        at com.google.inject.spi.Elements.getElements(Elements.java:101)
>        at
> com.google.inject.InjectorShell$Builder.build(InjectorShell.java:135)
>        at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:102)
>        at com.google.inject.Guice.createInjector(Guice.java:92)
>        at com.google.inject.Guice.createInjector(Guice.java:69)
>        at com.google.inject.Guice.createInjector(Guice.java:59)
>        at
>
> org.codehaus.plexus.DefaultPlexusContainer.addPlexusInjector(DefaultPlexusContainer.java:456)
>        at
>
> org.codehaus.plexus.DefaultPlexusContainer.(DefaultPlexusContainer.java:190)
>        at
>
> org.codehaus.plexus.DefaultPlexusContainer.(DefaultPlexusContainer.java:149)
>        at
>
> com.oneandone.devel.modules.pws.pwsp.embedder.MavenEmbedderUtils.buildPlexusContainer(MavenEmbedderUtils.java:148)
>        at
>
> com.oneandone.devel.modules.pws.pwsp.embedder.MavenEmbedderUtils.buildPlexusContainer(MavenEmbedderUtils.java:125)
>        at
>
> com.oneandone.devel.modules.pws.pwsp.embedder.MavenEmbedder.(MavenEmbedder.java:92)
>        at
>
> com.oneandone.devel.modules.pws.pwsp.PustefixWorkspaceMavenPluginReplacement.openWorkspace(PustefixWorkspaceMavenPluginReplacement.java:118)
>        at
> com.oneandone.devel.modules.pws.core.Workspace.doCreate(Workspace.java:100)
>        at
>
> com.oneandone.devel.modules.pws.cli.PustefixWorkspaceCLI.workspaceCreateCommand(PustefixWorkspaceCLI.java:384)
>        at
>
> com.oneandone.devel.modules.pws.cli.PustefixWorkspaceCLI.run(PustefixWorkspaceCLI.java:129)
>        at com.oneandone.devel.modules.pws.cli.CLI.(CLI.java:35)
>        at
>
> com.oneandone.devel.modules.pws.cli.PustefixWorkspaceCLIWorkspaceIT.commandWorkspaceCreateTest(PustefixWorkspaceCLIWorkspaceIT.java:149)
> Caused by: java.lang.IllegalArgumentException:
> org.sonatype.inject.Parameters is not a binding annotation. Please annotate
> it with @BindingAnnotation.
>

Looks like a known Surefire bug when using TestNG - recent releases of
TestNG include Guice 2 as a dependency and it leaks onto the test classpath.
Guice 2 doesn't have JSR330 support, hence the error (it only looks for
Guice's BindingAnnotation, and doesn't see the javax.inject.Qualifier
annotation)

Solution is to use this configuration for now:

        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.7.2</version>
          <configuration>
            <useSystemClassLoader>false</useSystemClassLoader>
          </configuration>
        </plugin>

then upgrade to Surefire 2.7.3 when it's released, where this should be
fixed properly: http://jira.codehaus.org/browse/SUREFIRE-699


>        at
>
> com.google.inject.internal.Preconditions.checkArgument(Preconditions.java:113)
>        at com.google.inject.Key.ensureIsBindingAnnotation(Key.java:367)
>        at com.google.inject.Key.strategyFor(Key.java:354)
>        at com.google.inject.Key.get(Key.java:246)
>        at
> org.sonatype.guice.bean.binders.ParameterKeys.(ParameterKeys.java:25)
>        ... 59 more
>
> Does someone has a good hint or may be an idea?
>
> Many thanks in advance.
>
> Kind regards
> Karl Heinz Marbaise
>
> -----
> Kind regards
> Karl Heinz Marbaise
> ----
> http://www.soebes.de
> http://www.skmwiki.de
> http://supose.org/wiki/supose
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Integrate-Maven-Plugin-Code-Mojo-s-into-Application-tp3397120p3413889.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>


-- 
Cheers, Stuart

Reply via email to