java - 未能执行目标 org.springframework
问题描述
我的 Maven 项目标志错误:无法在项目 pet-clinic-data 上执行目标 org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:repackage (repackage):执行目标 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>
解决方案
尝试添加:
<!-- 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>
推荐阅读
- php - 设置必填字段和空值
- java - 在我关闭屏幕并重新打开之前,Firebase 搜索不会自动更新
- javascript - 为什么不情愿的量词选择下一个原子正则表达式参数?
- python - 有没有办法获取 groupby 中最后一个值的出现次数?
- typescript - 在打字稿的泛型中使用泛型
- html - 如何内联显示 ::before 元素(与元素的文本并排)
- bazel - 将 CMake 包与 bazel cmake_external 链接
- tensorflow - 修改 TensorFlow 模型的各个层
- c++ - 数组中向量的 C++ 代码块问题
- java - 我无法根据输入参数返回值