执行org.apache.maven.plugins时缺少必需的类:maven-compiler-plugin:3.5.1:compile:org / apache / maven / shared / utils / StringUtils

问题描述 投票:0回答:1

我是初学者..我正在尝试弹簧启动机智休息服务在春天工具套件..我哈瓦从网站复制项目...我无法清除错误..我发布为图像..提前谢谢这个是我的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>com</groupId>
    <artifactId>javainterviewpoint</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>


    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.1.RELEASE</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>spring-releases</id>
            <url>https://repo.spring.io/libs-release</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-releases</id>
            <url>https://repo.spring.io/libs-release</url>
        </pluginRepository>
    </pluginRepositories>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <name>javainterviewpoint</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>


</project>

enter image description here

rest maven spring-boot spring-tool-suite
1个回答
0
投票

这里有几点想法:

(1)如果您从https://spring.io/tools运行最新版本的Spring Tool Suite(3.9.x),则无需从网站复制项目即可开始使用。您可以转到名为“导入Spring入门内容”的向导,然后选择“休息服务”指南。它会将准备使用的项目导入您的工作区。

(2)我不确切知道你的构建出了什么问题,但看起来你正在从STS内部运行Maven命令行。你不需要这样做。 STS在您的IDE中集成了Maven,可以为您提供一切。无需从命令行或上下文菜单运行Maven构建。只需打开启动仪表板,选择您的项目,然后按“运行”。

(3)如果你真的想从命令行运行Maven构建,你肯定可以这样做。您发布的图片并没有真正揭示出现了什么问题,但是从您的标题中(它提到了一个缺少类的内容)我模糊地猜测它可能与破坏或损坏的本地maven缓存有关。因此,删除您当地的maven存储库(通常位于〜/ .m2 / repository)并再次运行您的构建。这将再次下载所有必要的依赖。

希望这可以帮助!

© www.soinside.com 2019 - 2024. All rights reserved.