我一直试图将我的spring-boot应用程序打包成一个war文件,但错误不断出现,到目前为止我已经解决了3但我仍然坚持这个。
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.3.5.RELEASE:repackage
(default) on project pns: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.3.5.RELEASE:repackage failed:
A required class was missing while executing org.springframework.boot:spring-boot-maven-plugin:1.3.5.RELEASE:repackage:
org/springframework/boot/loader/tools/LaunchScript
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<start-class>iq.pns.PushNotificationServerApplication</start-class>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>${start-class}</mainClass>
<layout>WAR</layout>
</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.17</version>
</plugin>
</plugins>
</build>
为什么会发生这种情况? 提前谢谢。
答案 0 :(得分:1)
原来是Maven缓存中的一个损坏的jar,就像@AndyWilkinson建议的那样。
通过删除~/.m2/repository
folderand让Maven重新下载所有内容来解决。