Reputation: 121
I am facing an issue in IntelliJ when I tried to build my project through maven using
mvn clean install
I have tried different ways like changing the path of my JDK but nothing worked. Can someone help me out with this issue?
Upvotes: 9
Views: 28562
Reputation: 345
If anyone is using a plain Kotlin
project (without any build tool such as maven or gradle) in IntelliJ IDEA, then you can add the jetbrain's jetbrains.annotations
library by following the steps given below:
Project
panel on your left hand side, and select the Open module settings
Libraries
under Project settings
+
symbol on the top of the library area and select the From Maven...
org.jetbrains:annotations
, and hit the search icon at the end of it. Then, wait for the dropdown to list the available versions of it.Download to:
option.OK
and you are done.Upvotes: 5
Reputation: 21
just put this code in the build gradle and it will work.
implementation 'org.jetbrains:annotations:16.0.2'
Upvotes: 2
Reputation: 1443
For me adding jetbrains
dependency worked fine.
Provide dependency something like this.
For Gradle:
implementation 'org.jetbrains:annotations:16.0.2'
Upvotes: 5
Reputation: 761
I had the same issue and arrived here looking for solutions, but I couldn't find the aforementioned pom.xml. Maybe because I'm not using Maven in my project. But I solved it by editing the MyProject.iml file.
I've added the following code inside the <component>
tags.
<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>
Now I can use the annotations in my project.
Upvotes: 0
Reputation: 1730
If you really need them, add the dependency in your pom.xml :
<!-- https://mvnrepository.com/artifact/org.jetbrains/annotations -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>16.0.1</version>
</dependency>
( https://mvnrepository.com/artifact/org.jetbrains/annotations/16.0.1 )
Upvotes: 4