gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 05:55:40 26 4
gpt4 key购买 nike

我是 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]

下面是我的pom.xml

4.0.0org.springframework.bootspring-boot-starter-parent2.5.5 com.example后端0.0.1-快照后端Spring Boot 的演示项目 11

    <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>

知道为什么不起作用吗?我已经根据其他人的错误尝试了很多方法,但都没有用。现在有点沮丧。任何帮助将不胜感激

最佳答案

这个错误基本上是由于插件问题。

通过运行这些命令为项目创建一个 jar

mvn clean install 然后是 java -jar jar-localtion.jar

关于java - 无法执行目标 org.springframework.boot :spring-boot-maven-plugin:2. 5.5:run (default-cli),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69412664/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com