Java 包org.jetbrains.annotations不存在
当我试图通过maven使用Java 包org.jetbrains.annotations不存在,java,intellij-idea,jetbrains-ide,Java,Intellij Idea,Jetbrains Ide,当我试图通过maven使用 mvn clean install 我尝试过不同的方法,比如改变JDK的路径,但都没有效果。有人能帮我解决这个问题吗?如果您确实需要,请在pom.xml中添加依赖项: <!-- https://mvnrepository.com/artifact/org.jetbrains/annotations --> <dependency> <groupId>org.jetbrains</groupId> <
mvn clean install
我尝试过不同的方法,比如改变JDK的路径,但都没有效果。有人能帮我解决这个问题吗?如果您确实需要,请在pom.xml中添加依赖项:
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>16.0.1</version>
</dependency>
org.jetbrains
)我遇到了同样的问题,来到这里寻找解决方案,但我找不到前面提到的pom.xml。也许是因为我没有在我的项目中使用Maven。但我通过编辑MyProject.iml文件解决了这个问题。
我在
标记中添加了以下代码
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/annotations/20.1.0/annotations-20.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
现在我可以在我的项目中使用注释了。所有内容都添加了,intellij在编译时没有显示错误。但是我不能建造这个项目。它显示了clean install commandIntelliJ在运行时的错误,因为Intellij知道这些注释!这很正常。不管这个包在dep中,它都应该与maven一起工作。你能把整个pom.xml也贴出来吗?检查一下是否有遗漏?