You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Joseph Walton (JIRA)" <ji...@apache.org> on 2019/04/29 13:04:00 UTC

[jira] [Commented] (MNG-6580) Unable to inject annotations from classes compiled for Java 9+

    [ https://issues.apache.org/jira/browse/MNG-6580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16829241#comment-16829241 ] 

Joseph Walton commented on MNG-6580:
------------------------------------

Sisu's ASM has [been slightly upgraded|https://github.com/eclipse/sisu.inject/commit/ae6e9d93785e11447a12b0eab964412bf51eb29e], but the 0.3.3 release's copy of ASM [still only handles 1.8|https://github.com/eclipse/sisu.inject/blob/6082fa8588c4eca77592e26dc466239d3be8087f/org.eclipse.sisu.inject/src/org/eclipse/sisu/space/asm/ClassReader.java#L169].

Upstream ASM [currently supports Java 13|https://gitlab.ow2.org/asm/asm/blob/7a469bc9/asm/src/main/java/org/objectweb/asm/ClassReader.java#L193] classfiles.


> Unable to inject annotations from classes compiled for Java 9+
> --------------------------------------------------------------
>
>                 Key: MNG-6580
>                 URL: https://issues.apache.org/jira/browse/MNG-6580
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.6.0
>            Reporter: Sylwester Lachiewicz
>            Priority: Major
>
> While Sisu (0.3.3) is searching for implementation classes to be available for injection - it accepts only classes compiled for Java up to 8
> [https://github.com/eclipse/sisu.inject/blob/master/org.eclipse.sisu.inject/src/org/eclipse/sisu/space/asm/ClassReader.java#L168]
> If an implementation is compiled for Java 9+ warning will be logged (log.Sisu=trace) and class ignored.
> {code:java}
> [main] [TRACE] Sisu - Problem scanning: jar:file:/c:/programs/apache-maven-3.6.1-SNAPSHOT/bin/../lib/maven-core-3.6.1-SNAPSHOT.jar!/org/apache/maven/lifecycle/internal/LifecycleDependencyResolver.class
> java.lang.IllegalArgumentException
>  at org.eclipse.sisu.space.asm.ClassReader.<init> (ClassReader.java:170)
>  at org.eclipse.sisu.space.asm.ClassReader.<init> (ClassReader.java:153)
>  at org.eclipse.sisu.space.asm.ClassReader.<init> (ClassReader.java:424)
>  at org.eclipse.sisu.space.SpaceScanner.accept (SpaceScanner.java:102)
>  at org.eclipse.sisu.space.SpaceScanner.accept (SpaceScanner.java:78)
>  at org.eclipse.sisu.space.SpaceModule.scanForElements (SpaceModule.java:168)
>  at org.eclipse.sisu.space.SpaceModule.configure (SpaceModule.java:129)
>  at org.eclipse.sisu.plexus.PlexusAnnotatedBeanModule.configure (PlexusAnnotatedBeanModule.java:102)
>  at org.eclipse.sisu.plexus.PlexusBindingModule.configure (PlexusBindingModule.java:63)
>  at com.google.inject.spi.Elements$RecordingBinder.install (Elements.java:344)
>  at com.google.inject.spi.Elements.getElements (Elements.java:103)
>  at com.google.inject.spi.Elements.getElements (Elements.java:96)
>  at org.eclipse.sisu.wire.WireModule.configure (WireModule.java:75)
>  at com.google.inject.spi.Elements$RecordingBinder.install (Elements.java:344)
>  at com.google.inject.spi.Elements.getElements (Elements.java:103)
>  at com.google.inject.internal.InjectorShell$Builder.build (InjectorShell.java:137)
>  at com.google.inject.internal.InternalInjectorCreator.build (InternalInjectorCreator.java:103)
>  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.apache.maven.cli.MavenCli.container (MavenCli.java:635)
>  at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:281)
>  at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
>  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
>  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke (Method.java:566)
>  at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
>  at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
>  at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
>  at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
> {code}
> and a similar error is thrown
> {code:java}
> [WARNING] Error injecting: org.apache.maven.project.DefaultProjectBuildingHelper
> com.google.inject.ProvisionException: Unable to provision, see the following errors:
> 1) No implementation for org.apache.maven.classrealm.ClassRealmManager was bound.
>   while locating org.apache.maven.project.DefaultProjectBuildingHelper
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)