我有一個使用 Maven 的 git Eclipse 專案。我在一臺電腦上新建了一個Eclipse專案,匯入源代碼,構建成功。然后我提交并將我的更改推送到 GitHub。
當我在另一臺計算機 (OS X) 上克隆專案并將其匯入時,在嘗試構建時出現此錯誤:
Could not read maven project
當我單擊以獲取更多詳細資訊時,我看到:
Could not read maven project
Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM /Users/spertus/src/wordui/pom.xml: /Users/spertus/src/wordui/pom.xml (No such file or directory) @
當然沒有pom.xml檔案。我不再使用 Maven。
當我打開專案屬性時,專案性質下列出的唯一專案是 Java。
這是.project檔案:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>wordui</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
我嘗試重新打開 Eclipse,清理專案,洗掉并重新匯入它,但沒有效果。
我不認為.classpath應該重要,但這里是:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/javafx-jre17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Wordnik API"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/JavaFX 17"/>
<classpathentry kind="output" path="bin"/>
</classpath>
我正在為 Java 開發人員使用 Eclipse 2022-03。運行配置在 Java Application 下。
uj5u.com熱心網友回復:
我無法解決這個問題,但我能夠通過以下方式解決它:
- 創建一個全新的 Java 專案。
- 匯入舊的源代碼。
- 添加庫。
- 使用默認運行配置運行。
換句話說,如果你達到這個狀態,創建一個新專案。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/464846.html
上一篇:Ehcache2Maven依賴
下一篇:配置資料源失敗:未指定“url”屬性,無法配置嵌入式資料源//找不到application.properties
