Eclipse 版本 2024-06 使用 tycho 插件,但使用 Maven 构建会生成以下错误。
无效的插件执行映射(插件执行“org.eclipse.tycho:tycho-packaging-plugin:4.0.7:build-qualifier (执行:默认构建限定符,阶段:验证)”)。 要启用完整功能,请更正无效映射并运行 Maven->更新项目配置。 pom.xml Maven 项目构建生命周期映射问题
在Tycho版本4.0.8(4.0.6/4.0.7)中,这个问题仍然存在,但是每次我在Eclipse中对指定项目手动执行“Maven -> Update Project...”时,不再出现该错误。但是,只要我在这个项目中编辑某个Java代码,错误就会继续出现:
Failed to execute mojo org.eclipse.tycho:tycho-packaging-plugin:4.0.8:package-plugin {execution: default-package-plugin} (org.eclipse.tycho:tycho-packaging-plugin:4.0.8:package-plugin:default-package-plugin:package)
Detailed stack trace information:
org.eclipse.core.runtime.CoreException: Failed to execute mojo org.eclipse.tycho:tycho-packaging-plugin:4.0.8:package-plugin {execution: default-package-plugin}
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeMojo(MavenExecutionContext.java:404)
> at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.lambda$2(MavenExecutionContext.java:355)
> at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:458)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:339)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:354)
at org.eclipse.m2e.core.project.configurator.MojoExecutionBuildParticipant.build(MojoExecutionBuildParticipant.java:57)
at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.lambda$2(MavenBuilderImpl.java:159)
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
at org.eclipse.m2e.core.internal.builder.MavenBuilderImpl.build(MavenBuilderImpl.java:139)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:164)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$1.method(MavenBuilder.java:1)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$1(MavenBuilder.java:109)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:458)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:292)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$0(MavenBuilder.java:100)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:458)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:339)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:278)
at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:83)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:192)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1077)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:296)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:352)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:441)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:444)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:555)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:503)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:585)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:207)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:300)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-package-plugin of goal org.eclipse.tycho:tycho-packaging-plugin:4.0.8:package-plugin failed: Project com.example:xlibs.examp:eclipse-plugin:5.0.0-SNAPSHOT does not have an expanded version
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeMojo(MavenExecutionContext.java:402)
... 32 more
Caused by: java.lang.IllegalStateException: Project com.example:xlibs.examp:eclipse-plugin:5.0.0-SNAPSHOT does not have an expanded version
at org.eclipse.tycho.core.osgitools.DefaultReactorProject.getExpandedVersion(DefaultReactorProject.java:255)
at org.eclipse.tycho.packaging.PackagePluginMojo.getManifest(PackagePluginMojo.java:344)
at org.eclipse.tycho.packaging.PackagePluginMojo.createPluginJar(PackagePluginMojo.java:279)
at org.eclipse.tycho.packaging.PackagePluginMojo.execute(PackagePluginMojo.java:184)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
... 33 more