IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/mybatis-plus-support-jar

Posted 秋9

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/mybatis-plus-support-jar相关的知识,希望对你有一定的参考价值。

【现象】

Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/mybatis-plus-support-2.3.2.jar
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:113)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87)
        at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:69)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Caused by: java.io.IOException: Unable to open nested jar file 'BOOT-INF/lib/mybatis-plus-support-2.3.2.jar'
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:261)
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:247)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:109)
        ... 4 more

【原因】手动把jar拷贝到pom.xml项目打包的项目jar中导致

【解决方法】

pom.xml文件中

			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>2.2.1.RELEASE</version>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

修改为:

			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>2.2.1.RELEASE</version>
				<configuration>
					<includeSystemScope>true</includeSystemScope>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

以上是关于IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/mybatis-plus-support-jar的主要内容,如果未能解决你的问题,请参考以下文章

IllegalStateException:无法订阅。处理器已终止

Java.lang.IllegalStateException:已附加

转:java.lang.IllegalStateException异常产生的原因及解决办法

java.lang.IllegalStateException:片段未附加到活动

EJB java.lang.IllegalStateException

错误:java.lang.IllegalStateException:没有包含点