maven打包时,代码和依赖jar分离

pom.xml

正常打包

    
    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    
                        
                            org.projectlombok
                            lombok
                        
                    
                
            
        
    

依赖和代码分开打包

    
    
        deal-goin
        
            
                src/main/java
                
                    **/*.xml
                
            
            
                src/main/resources
                
                    *.*
                    */*
                
            

        
        
            
                org.apache.maven.plugins
                maven-dependency-plugin
                3.1.1
                
                    
                        copy-dependencies
                        package
                        
                            copy-dependencies
                        
                        
                            
                            ${project.build.directory}/lib
                            false
                            false
                            runtime
                        
                    
                
            
            
                org.apache.maven.plugins
                maven-jar-plugin
                3.1.1
                
                    
                        *.docx
                        META-INF/**
                    
                
            
            
                org.springframework.boot
                spring-boot-maven-plugin
                2.4.3
                
                    ZIP
                    
                        
                            non-exists
                            non-exists
                        
                    
                    true
                
                
                    
                        
                            repackage
                        
                    
                
            
        
    

你可能感兴趣的:(maven打包时,代码和依赖jar分离)