赞
踩
gradle工程使用bootjar打包出jar之后,使用java -jar命令运行jar,然后程序报错
- Exception in thread "main" java.lang.IllegalStateException: Failed to get nestedarchive for entry BOOT-INF/lib/axis2-1.6.2.pom
- at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:108)
- at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:86)
- at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:70)
- at org.springframework.boot.loader.Launcher.launch(Launcher.java:49)
- at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
- Caused by: java.io.IOException: Unable to open nested jar file 'BOOT-INF/lib/axis2-1.6.2.pom'
- at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:254)
- at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:239)
- at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:103)
- ... 4 more
- Caused by: java.io.IOException: Unable to find ZIP central directory records after reading 28780 bytes
- at org.springframework.boot.loader.jar.CentralDirectoryEndRecord.<init>(CentralDirectoryEndRecord.java:65)
- at org.springframework.boot.loader.jar.CentralDirectoryParser.parse(CentralDirectoryParser.java:52)
- at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:121)
- at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:109)
- at org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:287)
- at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:262)
- at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:250)
- ... 6 more
查看工程,发现build.gradle文件中有一个ext: 'pom'设置,删除掉
重新打包,运行没有出现错误了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。