maven打包

 打包命令:clean package -Pdev -Dmaven.test.skip=true

 

maven打包_第1张图片

通过profiles传参:


  
        
            base
            
                true
            
            
                base
            
        
        
            dev
            
                true
            
            
                dev
            
        
        
            test
            
                test
            
        
    

 

 

资源文件的获取:

maven-resources-plugin

            
                org.apache.maven.plugins
                maven-resources-plugin
                
                    

                        copy-resources
                        compile
                        
                            copy-resources
                        
                        
                            
                            true

                            target/
                            
                            
                            
                                
                                    
                                    src/main/resources/${package.environment}
                                    true
                                
                            
                        
                    
                
            

 

依赖包的管理:

maven-dependency-plugin

            
                org.apache.maven.plugins
                maven-dependency-plugin
                2.10
                
                    
                        copy-dependencies
                        package
                        
                            copy-dependencies
                        
                        
                            target/lib
                            false
                            false
                            runtime
                        
                    
                
            

指定编译版本:

maven-compiler-plugin

            
                org.apache.maven.plugins
                maven-compiler-plugin
                
                    1.8
                    1.8
                
            

汇总即为:


        mqttserver2.0
        
            
                src/main/java
                
                    **/*.xml
                
            
        
        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                
                    1.8
                    1.8
                
            

            
                org.apache.maven.plugins
                maven-dependency-plugin
                2.10
                
                    
                        copy-dependencies
                        package
                        
                            copy-dependencies
                        
                        
                            target/lib
                            false
                            false
                            runtime
                        
                    
                
            

            
                org.apache.maven.plugins
                maven-resources-plugin
                
                    

                        copy-resources
                        compile
                        
                            copy-resources
                        
                        
                            
                            true

                            target/
                            
                            
                            
                                
                                    
                                    src/main/resources/${package.environment}
                                    true
                                
                            
                        
                    
                
            


            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    
                    true
                
            
        
    

 

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