Intellij Maven says Dependency not found but the same is working in eclipse - maven

I wanted to use Intellij to code but the issue is it is not recognizing one dependency but the same does not happen in Eclipse. Attached is the error I am getting.
Maven error Intellij
I tried the following things but none of them worked.
Maven reload all projects
Invalidate Cache
Maven Settings checked Always update snapshots
Maven clean and Install
Can someone guide me on this with what is the exact issue? Because it does not show any such error in eclipse. Why Intellij has this issue?

Related

Intellij Idea fails to sync with Gradle: JvmOptions error

I'm trying to open freshly created Gradle project in Intellij Idea 2020.1. However, when trying to sync with Gradle, either on startup or manually, Idea shows the following text in "build" window:
'void org.gradle.process.internal.JvmOptions.<init>(org.gradle.api.internal.file.FileCollectionFactory)''void org.gradle.process.internal.JvmOptions.<init>(org.gradle.api.internal.file.FileCollectionFactory)'
and the project is not being imported.
I'm not able to find any references to this error. Could you give me some hints on how to troubleshoot this problem?
This turned out to be the issue with incorrect updating.
As I found, the Gradle plugin in my Intellij Idea installation contained two copies of Gradle libraries, for two different version of Gradle. In the fresh installation of Intellij Idea, there is only the Gradle 6.1. By removing the old version of Gradle from the plugin, problem was resolved.

Maven project builds but dependencies seem to be unavailable in IntelliJ IDEA

I have a multi-level Maven project that builds fine on the command-line using mvn clean install and builds in IntelliJ IDEA (2019.3) by manually running the parent project's clean and install phase. The Problems view shows nothing wrong. When I open files that have certain external libraries, they show as being unable to be resolved:
I'm usually able to browse external libraries' contents in the project browser. I've noticed that these external libraries IntelliJ can't find are listed but not browsable.
Other people working on our project with the same code base and same IntelliJ version don't seem to have this problem. I've tried:
"Reimport all Maven projects"
File -> Invalidate Caches/Restart
Completely deleting my ~/.m2/repository
Completely deleting my $PROJECT_ROOT/.idea directory and reimporting
Recloning and reimporting the project from scratch
None of the above seem to work.
The root case for this problem was not identified and is still under investigation, but what can help is removing the IDE settings and starting with the defaults.

Importing to IntelliJ - Error package org.springframework.boot does not exist

Dear Stackoverflow Community, I have the following problem with my spring boot starter application. I imported the starter project as a new maven project into IntelliJ. But IntelliJ does not find the dependencies I specified in the pom.
Image of my Application Class:
If I try to run the project I get the following error message.
Image of the Error Message:
I already tried everything from re-installing IntelliJ to re-importing the project or redownloading the dependencies. I simply dont know why IntelliJ doesn´t find the dependencies.
My pom.xml looks as following
Image of my pom.xml:
The first time I tried to edit the pom.xml it said to me "this file does not belong to the project". Maybe this might be one reason.
Running the whole thing with 'mvn install' or 'mvn clean verify' works.
Try this and then build: mvn -U idea:idea
Had the same problem. I have tried everything: invalidating cache, deleting the whole .m2 folder, changing settings, reloding the project, nothing helped.
The solution for me was to delete the .iml files which are IntelliJ module files used for keeping module configuration. After reopening the project it worked.
The idea was not mine, I found the hint here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/203365204--package-does-not-exist-error-despite-autocomplete-being-aware-of-them
Sometimes your workspace could get corrupted.
In my case, I tried to Reload the project and it worked
in my case changed JDK version in Maven importer from JDK 11 to my local JDK version 1.8
Here is how my IntelliJ settings for spring boot application looks like
Click open -> browse your workspace -> and select POM.xml file
Check this in your intelliJ settings
Do this too [Settings --> Maven --> Importing]
I just had the same issue. My solution was to remove all dependencies from the pom, reload via maven -> Reload All Maven Projects. Run mvn compile. Add dependencies back to the pom, maven -> Reload All Maven Projects. Run mvn compile.
Now the Intellij build works.
You need to change Maven's JDK for importing option from Project JDK to the Path variable for Java on your machine.
You can get to this by going to Settings -> Build, Execution, Deployment -> Build Tools -> Maven -> Importing. Scroll down to the bottom and look for JDK for importing:. Select from the list the path variable for JAVA.
For Windows users, JAVA_HOME should be an option in the drop-down list.
Follow these steps, your problem should be solved. You just need to add Spring-framework-starter-web and Spring-framework-starter-tester from your pom.xml file.
Got to generate(ALT+Insert)
Add dependencies
Search "springframwork"
Add...
Here is the link
In my case, adding the project as maven project helped .

Apache log4j 1.2.17 missing artifact error on pom.xml maven

I added the apache log4j 1.2.17 dependency in my pom.xml maven project. After saving the changes I have a lot of errors which are mostly "missing artifacts error". What should I do to fix this error?
This is the dependency I used from the maven repository
http://mvnrepository.com/artifact/log4j/log4j/1.2.17
I want to use Log4j as my logging framework for my selenium testing
Update your maven project by right click on it and choose options MAVEN>UPDATE PROJECT. It would resolve your problem.
If still you are getting same problem then use mvn eclipse:clean eclipse:eclipse to regenerate the eclipse project files -- hope that sorts you.

Spring STS MVC Project - Unable to Get Rid of Error

I have the newest STS build and have installed on Window 8.1. Following tutorials, I get a pom.xml error. Following any and all suggestions, including re-installing the STS does not fix it.
it is a maven configuration problem, try :
Right click on the project > run > maven build ...> goal : eclipse:clean
and then update the project
if the error is not fixed , then may be you have some corrupted dependencies
delete the folder .m2 under C:\Users\<the current user>\.m2 and update the project again, maven will load the missing jars again.

Resources