Build failing unable to find dependencies

已回答

Struggling to find out why IntelliJ won't compile some code that compiles fine from maven command line

12/8/22, 8:59 PM - Build completed with 100 errors and 0 warnings in 9 sec, 735 ms

java: package org.springframework.data.mongodb.repository does not exist

 

 

I just updated IntelliJ to use

IntelliJ IDEA 2022.3 (Ultimate Edition)
Build #IU-223.7571.182, built on November 29, 2022

The Maven tool window no longer shows dependencies, but there is a tab now that lists dependencies.

Is this a feature of new version (2022.3)?

NOTE: I've gotten the error

Cannot connect to the Maven process. Try again later. If the problem persists, check the Maven Importing JDK settings and restart IntelliJ IDEA

But does not say what to change to "check these settings".

I checked Build, . . . | Build Tools | Maven | Importing and 

JDK for importer: Use Project JDK (version 11.0.13; path: /usr/lib/jvm/java-11-openjdk)

is selected.

The maven pom.xml has spring defined


<properties>
        <spring.boot.version>2.7.3</spring.boot.version>
        <openapi.version>1.6.6</openapi.version>
</properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>


<dependencies>

<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>

<!-- Core Spring Dependencies -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
</dependency>

<!-- Spring Boot Dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>${spring.boot.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
<version>${spring.boot.version}</version>
</dependency>

<!-- MongoDB -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>bson</artifactId>
</dependency>

<!-- Swagger API -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${openapi.version}</version>
</dependency>

 

 

 

 

0

Please report at https://youtrack.jetbrains.com/newIssue?project=IDEA with the logs attached: Help | Collect Logs and Diagnostic Data.

0

Serge Baranov - Hi, I have this same issue for openapi generated files not finding dependencies.   Has this been reported somewhere already.  Same version of Intellij. 2022.3.1 Ultimate

0

Please share the ticket ID if it was already reported.

0

Also, the ide won't let me update the mave repo index

 

0

If I search for the dependency it will show it (ie javax.annotation:java.annotation-api) but since its already in the external libraries it won't let me 'add' it.   Yet @java.annotation.Nullable is in the 'red'.  This happens with other non-annotations

 

0

And a search on @Nullable will not show javax.annotation in the drop down.

0

请先登录再写评论。