Springboot项目按自定义的jar包方式打包

不多说了,直接贴上代码,大家先看看,后续有时间再逐一说明各项含义:

这种打包形式,可以将jar包放到工程的lib目录下,.sh的启动文件可以拷贝到打包的target下的根目录下,这样每次更新项目的时候,上传的jar包就会小至了1/10,方便部署。


        
            
                
                
            
            
                org.apache.maven.plugins
                maven-compiler-plugin
                
                    ${java.version}
                    ${java.version}
                    UTF-8
                    
                        
                    
                
            
            
                org.apache.maven.plugins
                maven-dependency-plugin
                
                    
                        copy-dependencies
                        prepare-package
                        
                            copy-dependencies
                        
                        
                            
                                ${project.build.directory}/lib/
                            
                            false
                            false
                        
                    
                
            
            
            
                org.apache.maven.plugins
                maven-resources-plugin
                2.6
                
                    
                        copy-resources
                        package
                        
                            copy-resources
                        
                        
                            UTF-8
                            
                            ${project.build.directory}/config
                            
                                
                                    src/main/resources/
                                    true
                                    
                                        *.sh
                                    
                                
                            
                        
                    
                    
                        copy-command
                        package
                        
                            copy-resources
                        
                        
                            UTF-8
                            
                            ${project.build.directory}
                            
                                
                                    src/main/resources/
                                    true
                                    
                                        *.sh
                                    
                                
                            
                        
                    
                
            
            
                org.apache.maven.plugins
                maven-jar-plugin
                
                    
                        
                            true
                            lib/
                            
                                com.zaitong.web.CKJApplication
                            
                        
                    
                
            
        
    

你可能感兴趣的:(java,maven,maven打包)