I tried to open a maven project with Intellij. The project was originally created on eclipse and worked fine.
However I receive an error
Dependency 'io.reactivex.rxjava2:rxjava:2.2.19' not found
(I get the same error if I try to start a new project in Intellij with the rxjava dependency)
Here is my dependencies section in the POM file:
<dependencies>
<dependency>
<groupId>io.reactivex.rxjava2</groupId>
<artifactId>rxjava</artifactId>
<version>2.2.19</version>
</dependency>
</dependencies>
What am I doing wrong?
running
mvn clean install
from command line, solved the issue
Related
I'm trying to add the following dependency in the pom.xml with IntelliJ
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
The issue is that the spring-boot-devtools does not get added in my "External libraries" folder as it should as per https://www.jetbrains.com/help/idea/work-with-maven-dependencies.html#maven_dependency_multi_module
IntelliJ gives me the error :
Dependency 'org.springframework.boot:spring-boot-devtools:3.0.1' not found
Why is the new dependency not added properly ?
In order to have the dependency installed, you have to right click on the pom.xml > Maven > Reload project.
The dependency gets added in the Externam Libraries folder and the error in pom.xml disappears
Some classes in my spring boot maven project were showing errors on some imports , so I had to add an external jar dependency in my IntellIJ (Community) . After adding it all the errors are gone , and i can see the jar is listed inside external libraries in IntelliJ . I try to run the spring boot project , works fine . But when i try to do a mvn clean install or mvn clean on the project directory , it fails showing import errors on the same classes for which purpose i had added the jar . I tried re-building the project , invalidating caches , but issue still remains the same . I am not able to understand if adding the JAR has resolved the import errors , and project also starts , why mvn phases are having failure as if no jar is added ?
In a Maven based project you must manage project build configuration, including dependency management in Maven pom.xml build files, not adding it via IDE interface. So you need to add the required dependencies using the Maven's dependency management mechanism, simply inside Maven dependencies section. e.g.
<dependencies>
...
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.3.4.RELEASE</version>
</dependency>
...
</dependencies>
And by the way the IDE helps you with that.
I have created a project using Spring Initializr with Spring Boot V-2.0.3
I am using STS 3.9.4 on Ubuntu Machine.
I am getting these errors:
The import org.springframework.boot.autoconfigure.SpringBootApplication cannot be resolved
SpringBootApplication cannot be resolved to a type
I have already tried deleting the repository folder from .m2 folder and hitting the following commands
mvn clean dependency:tree
mvn clean compile
But still errors were not resolved than I added an Extra Dependency to the POM file
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-autoconfigure -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<version>2.0.3.RELEASE</version>
</dependency>
I have updated the project by following the below steps after each step performed but still the error is not resolved.
STS Right click on project -> Maven -> Update Project
Go to STS Right click on project -> Maven -> Update Project.
I have added dependency for jersey-media-moxy in pom.xml,but I am getting
Missing artifact org.glassfish.jersey.media:jaxrs-media-moxy:jar:2.16
error message in pom.xml.
I have added necessary jar file to my build path.I have also updated the maven project using Force update ,still i am getting errors in the pom.xml.
<!-- https://mvnrepository.com/artifact/org.glassfish.jersey.media/jersey-media-moxy -->
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-moxy</artifactId>
<version>2.16</version>
</dependency>
that would do the job for you!
happy coding...
I am working on a Grails project that needs to compile with both Grails and Maven. Everything worked great except for my GSON converter I added (using the grails-gson plugin). Now I get the following when I run mvn install.
unable to resolve class grails.plugin.gson.converters.GSON
Anyone know how to overcome this
Plugin has to be added as a dependency in pom.xml too
<dependency>
<groupId>org.grails.plugins</groupId>
<artifactId>gson</artifactId>
<version>1.1.4</version>
<type>zip</type>
</dependency>
Mavenized grails project refer pom file for all dependencies (including plugin dependencies).