gpt4 book ai didi

java - Maven构建多模块项目成功,Eclipse报错

转载 作者:行者123 更新时间:2023-12-04 14:53:13 25 4
gpt4 key购买 nike

注意:这个问题类似于this one ,但那里的答案对我不起作用。

我有一个奇怪的问题:在命令行中使用 Maven,我的构建是成功的,但是在 Eclipse 中导入它仍然显示错误。特别是,我正在尝试构建开源 rosetta-dsl项目,这是一个包含 Xtext 和 Xtend 文件的多模块 Maven 项目。

运行 mvn clean install 以以下结果结束:

[INFO] Reactor Summary for com.regnosys.rosetta.parent 0.0.0.master:
[INFO]
[INFO] com.regnosys.rosetta.parent ........................ SUCCESS [ 0.282 s]
[INFO] com.regnosys.rosetta.lib ........................... SUCCESS [ 17.832 s]
[INFO] com.regnosys.rosetta ............................... SUCCESS [02:22 min]
[INFO] com.regnosys.rosetta.target ........................ SUCCESS [ 0.114 s]
[INFO] com.regnosys.rosetta.blueprints .................... SUCCESS [ 1.168 s]
[INFO] com.regnosys.rosetta.tests ......................... SUCCESS [ 40.176 s]
[INFO] com.regnosys.rosetta.ide ........................... SUCCESS [ 3.613 s]
[INFO] com.regnosys.rosetta.ui ............................ SUCCESS [ 3.721 s]
[INFO] com.regnosys.rosetta.ui.tests ...................... SUCCESS [ 21.185 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:08 min
[INFO] Finished at: 2021-08-06T14:59:53+02:00
[INFO] ------------------------------------------------------------------------

Eclipse 显示 40 个错误,包括:

Bundle 'net.bytebuddy.byte-buddy' cannot be resolved    MANIFEST.MF /com.regnosys.rosetta.lib/META-INF  line 16 Plug-in Problem
Bundle 'org.apache.commons.lang3' cannot be resolved MANIFEST.MF /com.regnosys.rosetta/META-INF line 24 Plug-in Problem
Bundle 'org.mockito' cannot be resolved MANIFEST.MF /com.regnosys.rosetta.lib/META-INF line 15 Plug-in Problem
Bundle 'org.mockito' cannot be resolved MANIFEST.MF /com.regnosys.rosetta.tests/META-INF line 20 Plug-in Problem
Bundle 'org.objenesis' cannot be resolved MANIFEST.MF /com.regnosys.rosetta.lib/META-INF line 17 Plug-in Problem
Bundle org.apache.commons.lang3 cannot be resolved build.properties /com.regnosys.rosetta line 21 Plug-in Problem
org.mockito.Mockito cannot be resolved to a type. DocReferenceTest.xtend /com.regnosys.rosetta.tests/src/com/regnosys/rosetta/generator/java/docrefs line: 19 /com.regnosys.rosetta.tests/src/com/regnosys/rosetta/generator/java/docrefs/DocReferenceTest.xtend Xtend Problem
The method mock(Class<Attribute>) is undefined RosettaExpressionJavaGeneratorTest.xtend /com.regnosys.rosetta.tests/src/com/regnosys/rosetta/generator/java/qualify line: 282 /com.regnosys.rosetta.tests/src/com/regnosys/rosetta/generator/java/qualify/RosettaExpressionJavaGeneratorTest.xtend Xtend Problem
The method when(Object) is undefined RosettaExpressionJavaGeneratorTest.xtend /com.regnosys.rosetta.tests/src/com/regnosys/rosetta/generator/java/qualify line: 269 /com.regnosys.rosetta.tests/src/com/regnosys/rosetta/generator/java/qualify/RosettaExpressionJavaGeneratorTest.xtend Xtend Problem

我尝试过的:

  • 右键单击项目并运行 Maven > Update Project...(即 the top anwser of the similar post)
  • 删除项目并将其重新导入为 Maven 项目
  • 将 Maven、m2e Eclipse 插件和 Eclipse 更新到最新版本
  • 运行 mvn clean,项目 > 清理,关闭并重新打开项目,...并重建

但问题依然存在,在过去三天无果而终地寻找解决方案后,我不确定如何继续。

我不知道这个项目如何或为什么与链接问题中的不同,所以这里有更多详细信息:

  • > mvn --version
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: C:\Users\Thesis\apache-maven-3.8.1\bin\..
Java version: 11.0.2, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11.0.2
Default locale: nl_NL, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
  • Eclipse 中的 JDK 合规性设置为 11
  • 我正在运行 Eclipse DSL 工具版本 2021-06 (4.20.0)

知道如何解决这个问题吗?

最佳答案

对于插件开发,Eclipse 需要配置一个目标平台。您可以在 com.regnosys.rosetta.target 项目中找到一个目标文件。如果您使用目标编辑器打开该文件,您将在右上角找到一个按钮,允许您将该文件设置为 eclipse 中的 Activity 目标平台。

关于java - Maven构建多模块项目成功,Eclipse报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68682533/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com