【问题标题】:Failed to execute goal org.springframework未能执行目标 org.springframework
【发布时间】:2019-08-30 02:39:46
【问题描述】:

我的 Maven 项目标志 ERROR: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:repackage (repackage) on project pet-clinic-data: Execution repackage of goal org .springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:repackage failed: Unable to find main class

这是我的依赖

<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>sfg-pet-clinic</artifactId>
        <groupId>guru.springframework</groupId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>pet-clinic-web</artifactId>

<dependencies>
    <dependency>
        <artifactId>pet-clinic-data</artifactId>
        <groupId>guru.springframework</groupId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

</project>

【问题讨论】:

  • [ERROR] 要查看错误的完整堆栈跟踪,请使用 -e 开关重新运行 Maven。 [错误] 使用 -X 开关重新运行 Maven 以启用完整的调试日志记录。 [ERROR] [ERROR] 有关错误和可能的解决方案的更多信息,请阅读以下文章: [ERROR] [Help 1] cwiki.apache.org/confluence/display/MAVEN/… [ERROR] [ERROR] 更正问题后,您可以使用命令 [错误] mvn -rf :pet-clinic-data
  • 我知道你很久以前就问过这个问题,但你还记得你是如何解决这个问题的,目前面临同样的问题
  • 我偶尔会遇到这种情况。只需从终端/命令提示符运行mvn clean 即可清除它 - 一段时间。这是一个反复出现的问题。

标签: java spring maven spring-boot


【解决方案1】:

尝试添加:

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-maven-plugin -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <version>2.1.3.RELEASE</version>
</dependency>

【讨论】:

  • 也许可以尝试为构建添加编译器和 mapstruct 插件。只是预感,我还是初学者。
猜你喜欢
  • 1970-01-01
  • 2016-08-11
  • 2015-02-01
  • 2013-10-11
  • 1970-01-01
  • 2018-09-15
  • 1970-01-01
  • 1970-01-01
  • 2018-01-02
相关资源
最近更新 更多