springboot maven插件打包报错:程序包jdk.internal.org.objectweb.asm不存在

在使用springboot maven插件构建项目时报错jdk.internal.org.objectweb.asm不存在,原因是 rt包没有打包到项目中去,需要在pom。xml文件中配置将jdk的相关jar打入项目中,如下:

<plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <encoding>UTF-8</encoding>
        <compilerArguments>
            <verbose />
            <!-- 将jdk的依赖jar打入项目中,这样项目中使用的jdk的依赖就尅正常使用 -->
            <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar;${java.home}/lib/jsse.jar</bootclasspath>
        </compilerArguments>
    </configuration>
</plugin>

之后重现执行mvn clean install就可以了。

posted @ 2020-04-13 17:17  花拾夕  阅读(10986)  评论(0编辑  收藏  举报