I have a strange problem in IntelliJ IDEA not recognizing dependencies when using an existing (working) maven application. The dependencies are successfully downloaded when building the application so they should be recognized by the application. Also not all dependencies the project uses are not recognized, only a small part.
I assume that the dependencies are not recognized because they are displayed in red in IntelliJ
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.BufferingClientHttpRequestFactory;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.MultipartBodyBuilder;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.databind.ObjectMapper;
Below a summary of the things I did so far in the same order:
package com.fasterxml.jackson.databind does not exist
package org.springframework.boot does not exist
package org.springframework.boot does not exist
package org.springframework.boot.autoconfigure does not exist
package org.springframework.http.client does not exist
package org.springframework.http.client does not exist
package org.springframework.http.client does not exist
package org.springframework.web.client does not exist
cannot find symbol class CommandLineRunner
cannot find symbol class SpringBootApplication
cannot find symbol class RestTemplate
cannot find symbol class HttpHeaders
cannot find symbol class RestTemplate
package org.springframework.http does not exist
Below the dependency section of my pom.xml
<dependencies>
<dependency>
<groupId>org.apachemons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.5</version>
</dependency>
<!-- .springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
</dependencies>
As said above the dependencies which are listed in red by IntelliJ are successfully downloaded and stored under the .m2 folder
Another thing I notified and which seems very strange is that when creating a run configuration there is no section of spring boot under the run options section. It should look like this:
enter image description here
But in my IDEA the section of spring boot options is missing. It seems that the application is not recognized as spring boot application.
Things I tried so far to solve the issue: