私はSpringツールスイートでmavenプロジェクトを作成しました。必要な依存関係を持つpom.xmlを作成しましたが、「SpringBootApplicationを型に解決できません」というエラーが発生しました。 私はMaven - > Update Project ...、Clean Project、Maven(.m2)などのローカルリポジトリディレクトリを削除したようないくつかのソリューションを試しました...また別のmavenプロジェクトを作成しようとしました。SpringBootApplicationをSpringツールスイートとMavenの型エラーに解決できません
これはmavenのEclipseツールスイートの問題です。 Eclipseやその他のパッチによる解決策はありますか? ありがとうございます!
のpom.xml
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.javabrains.springbootquickstart</groupId>
<artifactId>cource.api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Java Brains Cource API</name>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent -->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
</parent>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent -->
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.8.RELEASE</version>
<type>pom</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<properties>
<java.version>1.8</java.version>
</properties>
</project>
プロジェクトのコマンドラインからmvn clean installコマンドを試したことがありますか? –
'...型に解決できません。 'は、インポートが見つからないか、解決できないことを意味します。後者の場合、 'The import ... can not be resolve 'はあなたが見なければならないエラーです。このようなエラーがありますか? – howlger