java - SpringBoot重新打包失败如何解决?
问题描述
我目前正在学习使用多模块的 SpringBoot 教程。但是,当我尝试打包时,这会返回错误:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.5.RELEASE:repackage (repackage) on project pet-clinic-data: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.1.5.RELEASE:repackage failed: Unable to find main class -> [Help 1]
我试图在我的父 pom 文件中添加这样的内容:
<properties>
<java.version>1.8</java.version>
<start-class>guru.springframework.sfgpetclinic.SfgPetClinicApplication</start-class>
</properties>
但这会引发另一个错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project pet-clinic-web: There are test failures.
这是基于模块pet-clinic-data之一:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<skip>true</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
编辑!
@RunWith(SpringRunner.class)
@SpringBootTest
public class SfgPetClinicApplicationTests {
@Test
public void contextLoads() {
}
}
解决方案
推荐阅读
- r - 在ggplot中使用位置=“填充”时出错
- reactjs - 基于 getimagesize 返回视图 - react-native
- c# - 从 WCF Web 服务进行服务器端打印
- c# - 如何实现刷新到 aspx (DotNet) 页面的实时响应?
- r - 循环数据框并绘制均值和 CI
- javascript - 如何用 Jest 模拟 uuid
- events - 在 Hyperledger Fabric 中监听自定义链码事件
- c# - WPF 在另一个形状内绘制一个形状
- javascript - 将 3d 对象定位在画布的角落 - three.js
- android - Kotlin:抑制以大写字母开头的函数的警告