[ https://issues.apache.org/jira/browse/MNG-8027?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17902063#comment-17902063 ]
Basil Crow commented on MNG-8027: --------------------------------- I would expect that Maven can be embedded into an application running the latest version of Guice. This does not imply that Maven must upgrade to Guice 7—as suggested in https://issues.apache.org/jira/browse/JCLOUDS-1627?focusedCommentId=17810150&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17810150 upgrading to Guice 6.x and migrating from {{javax.inject}} to {{jakarta.inject}} should suffice. > Maven cannot be embedded in applications that have upgraded Guice to 7.0+ > ------------------------------------------------------------------------- > > Key: MNG-8027 > URL: https://issues.apache.org/jira/browse/MNG-8027 > Project: Maven > Issue Type: Bug > Components: Core > Affects Versions: 3.9.6 > Reporter: Basil Crow > Priority: Major > > With Java 17, install Jenkins 2.442, create a Maven installation for Maven > 3.9.6, and create a Maven project building e.g. > [https://github.com/basil/simple-maven-project-with-tests]. The job should > succeed. > Now run the same job against [https://github.com/jenkinsci/jenkins/pull/8889] > which upgrades Guice from 6.0 (which supports both {{javax.inject}} and > {{jakarta.inject}} imports) to 7.0 (which only supports {{jakarta.inject}} > imports). The job fails with: > {noformat} > java.lang.IllegalArgumentException: org.eclipse.sisu.Parameters is not a > binding annotation. Please annotate it with @BindingAnnotation. > at > com.google.common.base.Preconditions.checkArgument(Preconditions.java:218) > at com.google.inject.Key.ensureIsBindingAnnotation(Key.java:382) > at com.google.inject.Key.strategyFor(Key.java:370) > at com.google.inject.Key.get(Key.java:229) > at org.eclipse.sisu.wire.ParameterKeys.<clinit>(ParameterKeys.java:28) > Caused: java.lang.ExceptionInInitializerError > at > org.eclipse.sisu.wire.DependencyAnalyzer.<init>(DependencyAnalyzer.java:93) > at > org.eclipse.sisu.wire.ElementAnalyzer.<init>(ElementAnalyzer.java:104) > at org.eclipse.sisu.wire.WireModule.configure(WireModule.java:74) > at > com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:426) > at com.google.inject.spi.Elements.getElements(Elements.java:113) > at > com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:160) > at > com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107) > at com.google.inject.Guice.createInjector(Guice.java:87) > 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:481) > at > org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:206) > at > org.codehaus.plexus.DefaultPlexusContainer.<init>(DefaultPlexusContainer.java:168) > at > hudson.maven.MavenEmbedderUtils.buildPlexusContainer(MavenEmbedderUtils.java:166) > at > hudson.maven.MavenEmbedderUtils.buildPlexusContainer(MavenEmbedderUtils.java:159) > at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:110) > at hudson.maven.MavenEmbedder.<init>(MavenEmbedder.java:137) > at hudson.maven.MavenUtil.createEmbedder(MavenUtil.java:211) > at > hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1324) > at > hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1124) > at hudson.FilePath.act(FilePath.java:1236) > at hudson.FilePath.act(FilePath.java:1219) > at > hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.parsePoms(MavenModuleSetBuild.java:985) > at > hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:689) > at > hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526) > at hudson.model.Run.execute(Run.java:1895) > at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543) > at hudson.model.ResourceController.execute(ResourceController.java:101) > at hudson.model.Executor.run(Executor.java:442) > {noformat} > This is blocking us from upgrading Guice from 6.0 to 7.0. -- This message was sent by Atlassian Jira (v8.20.10#820010)