org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [xxxApplication]; nested exception is java.io.FileNotFoundException: class path resource [xxx.class] cannot be opened because it does not exist
找了好多网上的解决方案,都不符合我本次错误,此次原因是POM中引入的版本为快照版本,但maven打包时,生成的MANIFEST.MF文件的jar地址为带时间戳和构建号的,但我实际的jar包为xxx-1.0.0-SNAPSHOT,导致程序找不到jar。
解决方法:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<archive>
<manifest>
<!-- 设置为false避免在MANIFEST.MF中添加时间戳和构建号 -->
<useUniqueVersions>false</useUniqueVersions>
</manifest>
</archive>
</configuration>
</plugin>
over。如果你解决了,请回来点赞,(#^_^#)!