![](/img/trans.png)
[英]Java Repository of Eclipse with Maven : Missing artifact:compile
[英]Maven update in Java 9, Maven compile in Java 8 in Eclipse
I have a project with Spring and Maven using Java version 8. When I run maven update it works with Java 9 or higher and when I compile it works well with Java 8. I have noticed this because updating with Maven changes a specific class to Java 9 我無法導入這個 class。
class 是:javax.annotation.Generated (Java 8)。
這是要導入的 class。 但是,當我執行 maven 更新文件的導入時,會將 class 更改為:javax.annotation.processing.Generated(Java 9 或更高版本)並且導入失敗。 當我編譯 class 的導入時,它會返回到 javax.annotation.Generated
不得不說我前幾天把項目更新到了最新版本的Spring,現在出現了問題。
有人能幫忙嗎?
提前致謝。
JDK/JRE 變得更小了, javax.*
中的所有內容都必須自己導入。 將此添加到您的pom
文件中:
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.