简体   繁体   English

无法执行目标 org.springframework.boot:spring-boot-maven-plugin:2.5.5:run (default-cli)

[英]Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.5:run (default-cli)

I'm new to Spring and I was trying to follow the tutorial given on its official website and this error pop up.我是 Spring 的新手,我试图按照其官方网站上给出的教程进行操作,但会弹出此错误。

Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.5:run (default-cli) on project backend: Application finished with exit code: 1 -> [Help 1]

The following is my pom.xml以下是我的pom.xml

4.0.0 org.springframework.boot spring-boot-starter-parent 2.5.5 com.example backend 0.0.1-SNAPSHOT backend Demo project for Spring Boot <java.version>11</java.version> 4.0.0 org.springframework.boot spring-boot-starter-parent 2.5.5 com.example backend 0.0.1-SNAPSHOT backend Spring Boot Demo project <java.version>11</java.version>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>4.3.7.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>4.3.7.RELEASE</version>
    </dependency>

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

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <mainClass>BackendApplication</mainClass>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>repackage</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.5.5</version>
            <configuration>
                <skipTests>false</skipTests>
                <testFailureIgnore>true</testFailureIgnore>
                <forkMode>once</forkMode>
            </configuration>
        </plugin>           
    </plugins>
    
</build>

Any idea why is not working?知道为什么不起作用吗? I have try many approaches based on other people's error but none of it work.我已经根据其他人的错误尝试了很多方法,但都没有奏效。 Kinda frustrated now.现在有点沮丧。 Any assistance would be appreciated任何援助将不胜感激

This error is basically due to a plugin issue.这个错误基本上是由于插件问题。

create a jar for the project by running these commands通过运行这些命令为项目创建一个 jar

mvn clean install and then java -jar jar-localtion.jar mvn clean install然后java -jar jar-localtion.jar

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未能执行目标 org.springframework.boot:spring-boot-maven-plugin:2.2.5.RELEASE:run (default-cli) - Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.5.RELEASE:run (default-cli) 无法执行目标 org.springframework.boot:spring-boot-maven-plugin:2.1.12.RELEASE:run (default-cli) - Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.12.RELEASE:run (default-cli) 无法在项目用户上执行目标 org.springframework.boot:spring-boot-maven-plugin:2.6.7:run (default-cli): - Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.6.7:run (default-cli) on project userms: 无法在项目 someProject 上执行目标 org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:run (default-cli):无法执行 java - Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.2.RELEASE:run (default-cli) on project someProject: Could not exec java 构建 docker 镜像时出错,无法在项目上执行目标 org.springframework.boot:spring-boot-maven-plugin:2.5.2:build-image (default-cli) - Error while building docker image, Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.2:build-image (default-cli) on project Maven - 无法执行目标 org.springframework.boot:spring-boot-maven-plugin:2.4.1:run - Maven - Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.1:run 无法执行目标 org.springframework.boot:spring-boot-maven-plugin:2.2.2.RELEASE:run - Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.2.RELEASE:run 无法执行目标org.springframework.boot:spring-boot-maven-plugin:1.5.8.RELEASE:run - Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.8.RELEASE:run 执行目标 org.springframework.boot:spring-boot-maven-plugin:2.4.4:repackage 的 default-cli 失败:无法找到主 class - Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:2.4.4:repackage failed: Unable to find main class org.apache.maven.lifecycle.LifecycleExecutionException:无法执行目标 org.springframework.boot:spring-boot-maven-plugin:2.4.8:run - org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.8:run
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM