





這是 pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.springframework.amqp.tutorials</groupId>
<artifactId>rabbitmq-amqp-tutorials</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>rabbitmq-amqp-tutorials</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
編輯:解決方案
正如@Sanura Hettiarachchi 所指出的,我使用的intellij idea 版本存在一個錯誤,卸載并安裝最新版本(Intellij Idea 2022.2.3 社區版)解決了這個問題。現在匯入現有專案效果很好,無需手動匯入模塊。
uj5u.com熱心網友回復:
目前尚不清楚您要達到的目標。您單擊“打開或匯入”并添加現有專案。之后,您嘗試再次匯入相同的專案。
如果要加載 maven 依賴項,請右鍵單擊“pom.xml”并選擇“maven->reload project”
更新: 問題似乎出在 IntelliJ IDE 舊版本上,現在應該修復。 https://youtrack.jetbrains.com/issue/IDEA-290419/Maven-385-NoSuchMethodError-orgapachemavenmodelvalidationDefaultModelValidator-method-void-init-not-found
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/527704.html
標籤:爪哇智能理念
