我目前正在使用多模块使用SpringBoot进行教程。但是,当我尝试做 package 时,会返回错误:
[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() {
}
}