当前位置: 首页 > 工具软件 > Apache Celix > 使用案例 >

java osgi 文件_java – 使用OSGi和Apache Felix iPOJO和JDK 11

赵英哲
2023-12-01

我有一个围绕OSGi和iPOJO构建的项目,我正在尝试确定它是否仍然适用于JDK 11.它目前正在使用JDK 8.由于iPOJO(1.12.1)的最新版本是最新版本,所以看起来并不太乐观. 2014年发布.更新目标和maven编译器版本后,我遇到以下问题:

[ERROR] Failed to execute goal org.apache.felix:maven-ipojo-plugin:1.12.1:ipojo-bundle (default) on project redacted: Execution default of goal org.apache.felix:maven-ipojo-plugin:1.12.1:ipojo-bundle failed. IllegalArgumentException -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.felix:maven-ipojo-plugin:1.12.1:ipojo-bundle (default) on project redacted: Execution default of goal org.apache.felix:maven-ipojo-plugin:1.12.1:ipojo-bundle failed.

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.PluginExecutionException: Execution default of goal org.apache.felix:maven-ipojo-plugin:1.12.1:ipojo-bundle failed.

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)

... 20 more

Caused by: java.lang.IllegalArgumentException

at org.objectweb.asm.ClassReader.(Unknown Source)

at org.objectweb.asm.ClassReader.(Unknown Source)

at org.apache.felix.ipojo.manipulator.metadata.annotation.model.parser.AnnotationParser.read(AnnotationParser.java:32)

at org.apache.felix.ipojo.manipulator.metadata.annotation.registry.MetaAnnotationBindingRegistry.createBindings(MetaAnnotationBindingRegistry.java:94)

at org.apache.felix.ipojo.manipulator.metadata.annotation.registry.CompletableBindingRegistry.getBindings(CompletableBindingRegistry.java:45)

at org.apache.felix.ipojo.manipulator.metadata.annotation.registry.CompletableBindingRegistry.getBindings(CompletableBindingRegistry.java:43)

at org.apache.felix.ipojo.manipulator.metadata.annotation.registry.CompletableBindingRegistry.getBindings(CompletableBindingRegistry.java:43)

at org.apache.felix.ipojo.manipulator.metadata.annotation.registry.Selection.list(Selection.java:129)

at org.apache.felix.ipojo.manipulator.metadata.annotation.registry.Selection.get(Selection.java:98)

at org.apache.felix.ipojo.manipulator.metadata.annotation.MethodMetadataCollector.visitAnnotation(MethodMetadataCollector.java:69)

at org.objectweb.asm.ClassReader.b(Unknown Source)

at org.objectweb.asm.ClassReader.accept(Unknown Source)

at org.objectweb.asm.ClassReader.accept(Unknown Source)

at org.apache.felix.ipojo.manipulator.metadata.AnnotationMetadataProvider.computeAnnotations(AnnotationMetadataProvider.java:111)

at org.apache.felix.ipojo.manipulator.metadata.AnnotationMetadataProvider.access$200(AnnotationMetadataProvider.java:44)

at org.apache.felix.ipojo.manipulator.metadata.AnnotationMetadataProvider$1.visit(AnnotationMetadataProvider.java:90)

at org.apache.felix.ipojo.manipulator.store.JarFileResourceStore.accept(JarFileResourceStore.java:161)

at org.apache.felix.ipojo.manipulator.metadata.AnnotationMetadataProvider.getMetadatas(AnnotationMetadataProvider.java:75)

at org.apache.felix.ipojo.manipulator.metadata.CompositeMetadataProvider.getMetadatas(CompositeMetadataProvider.java:53)

at org.apache.felix.ipojo.manipulator.Pojoization.pojoization(Pojoization.java:360)

at org.apache.felix.ipojo.manipulator.Pojoization.pojoization(Pojoization.java:243)

at org.apache.felix.ipojo.plugin.ManipulatorMojo.execute(ManipulatorMojo.java:265)

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

... 21 more

从粗略的一瞥,看起来maven-ipojo-plugin的asm依赖关系在使用JDK 11时遇到了麻烦,因为iPOJO对asm 5.0.4具有传递依赖性,并且直到asm才添加JDK 11支持7.0.我试图排除传递依赖,并添加asm 7.0作为依赖,但我仍然得到相同的错误.

感谢您的关注,我会感谢任何其他尝试或见解的想法.

 类似资料: