0

We have a microservices project which was running (in Karaf) and building with JDK 8.
Now I am trying to build it with JDK 11 (OpenJDK in fact) but I am getting this error.

Does that mean this plugin is not compatible with JDK 11?

Or does it mean something else?

On the official page of the plugin I do not see any info if the plugin is compatible with JDK 11. The plugin latest version seems to be 1.10.0 and that's the one I am trying to use (but that was last build in 2018 so was it replaced with something else?).

    [ERROR] Failed to execute goal org.apache.aries.blueprint:blueprint-maven-plugin:1.10.0:blueprint-generate (default) on project microservices: Error during blueprint generation: IllegalArgumentException -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.aries.blueprint:blueprint-maven-plugin:1.10.0:blueprint-generate (default) on project microservices: Error during blueprint generation
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
            at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
            at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
            at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
            at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
            at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:566)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
            at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
            at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
            at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    Caused by: org.apache.maven.plugin.MojoExecutionException: Error during blueprint generation
            at org.apache.aries.blueprint.plugin.GenerateMojo.execute(GenerateMojo.java:149)
            at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
            ... 20 more
    Caused by: java.lang.IllegalArgumentException
            at org.apache.xbean.asm5.ClassReader.<init>(Unknown Source)
            at org.apache.xbean.asm5.ClassReader.<init>(Unknown Source)
            at org.apache.xbean.asm5.ClassReader.<init>(Unknown Source)
            at org.apache.xbean.finder.AbstractFinder.readClassDef(AbstractFinder.java:580)
            at org.apache.xbean.finder.AbstractFinder.readClassDef(AbstractFinder.java:576)
            at org.apache.xbean.finder.AbstractFinder.readClassDef(AbstractFinder.java:562)
            at org.apache.xbean.finder.ClassFinder.<init>(ClassFinder.java:122)
            at org.apache.aries.blueprint.plugin.GenerateMojo.createProjectScopeFinder(GenerateMojo.java:220)
            at org.apache.aries.blueprint.plugin.GenerateMojo.generateBlueprint(GenerateMojo.java:155)
            at org.apache.aries.blueprint.plugin.GenerateMojo.execute(GenerateMojo.java:145)
            ... 22 more
    [ERROR]
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
peter.petrov
  • 38,363
  • 16
  • 94
  • 159

1 Answers1

2

I've just falled into several similar issues with blueprint-maven-plugin when migrating karaf-deployed projects from jdk8 to jdk11. As the blueprint-maven-plugin is still at version 1.10.0 since May 2018, following discussion within these issues

i have a workaround by overriding version of org.apache.xbean:xbean-finder-shaded to the latest version for the blueprint-maven-plugin:

<pluginManagement>
    <plugins>
        ...
        <plugin>
            <groupId>org.apache.aries.blueprint</groupId>
            <artifactId>blueprint-maven-plugin</artifactId>
            <version>1.10.0</version>
            <dependencies>
                <dependency>
                    <groupId>org.apache.xbean</groupId>
                    <artifactId>xbean-finder-shaded</artifactId>
                    <version>4.20</version>
                </dependency>
            </dependencies>
        </plugin>