spring-boot打包分离配置文件


        meta-cache
        
            
            
                org.apache.maven.plugins
                maven-jar-plugin
                
                    
                        
                            true
                            
                            lib/
                            
                            false
                            
                            ***.cache.CacheRun
                        
                        
                            
                            /resources
                        
                    
                    ${project.build.directory}/meta-cache
                
            

            
            
                org.apache.maven.plugins
                maven-dependency-plugin
                
                    
                        copy-dependencies
                        package
                        
                            copy-dependencies
                        
                        
                            
                                ${project.build.directory}/meta-cache/lib/
                            
                        
                    
                
            

            
            
                maven-resources-plugin
                
                    
                        copy-resources
                        package
                        
                            copy-resources
                        
                        
                            
                                
                                    src/main/resources/config
                                
                            
                            ${project.build.directory}/meta-cache/config
                        
                    
                
            

            
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    ZIP
                    
                    true
                
                
                    
                        
                            repackage
                        
                    
                
            
        
        
        
            
                true
                src/main/resources
                
                    config/*.properties
                
            
        
    

打包后的jar包运行命令:

进入到打包后的文件目录***./meta-cache

java  -Djava.ext.dirs=./lib -jar meta-cache.jar

你可能感兴趣的:(spring-boot)