springboot maven打包 mvn clean package 报错:程序包jdk.internal.org.objectweb.asm不存在

mvn打包报错:程序包jdk.internal.org.objectweb.asm不存在
原因是 rt包没有打包到项目中去

解决
pom.xml 打包配置编译条件,注意下面bootclasspath的 jar包路径是我当前jdk安装路径,读者需要看下自己的jdk安装路径做修改


    libs
    
    
    
    C:/Program Files/Java/jdk1.8.0_201/jre/lib/rt.jar;C:/Program Files/Java/jdk1.8.0_201/jre/lib/jce.jar;C:/Program Files/Java/jdk1.8.0_201/jre/lib/jsse.jar

完整pom.xml



    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        2.1.6.RELEASE
         
    
    com.example
    swagger2_demo
    0.0.1-SNAPSHOT
    swagger2_demo
    Demo project for Spring Boot

    
        1.8
    

    
        
            org.apache.commons
            commons-lang3
            3.8.1
        
        
            org.javassist
            javassist
            3.20.0-GA
        
        
            com.alibaba
            fastjson
            1.2.47
        
        
            org.json
            json
            20160810
        
        
            org.springframework.boot
            spring-boot-starter
        
        
            org.springframework.boot
            spring-boot-starter-test
            test
        
        
            io.springfox
            springfox-swagger2
            2.6.1
        
        
            io.springfox
            springfox-swagger-ui
            2.6.1
        
        
            org.springframework.boot
            spring-boot-starter-web
        
    
    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                1.4.2.RELEASE
                
                    
                        
                            repackage
                        
                    
                
                
                    com.example.swagger2_demo.Swagger2DemoApplication
                    JAR
                    true
                
            
            
                maven-compiler-plugin
                
                    1.8
                    1.8
                    UTF-8
                    
                        libs
                        
                        
                        
                        C:/Program Files/Java/jdk1.8.0_201/jre/lib/rt.jar;C:/Program Files/Java/jdk1.8.0_201/jre/lib/jce.jar;C:/Program Files/Java/jdk1.8.0_201/jre/lib/jsse.jar
                    
                
            
        
    



可以看下我之前的 swagger2 自定义参数和返回值的map/json注解 文章,有源码可以正常maven打包,已经解决了"程序包jdk.internal.org.objectweb.asm不存在" 这个问题.

你可能感兴趣的:(maven)