Springboot mavenパッケージpom構成

5014 ワード

1.pomのbuildラベル

		true
	
  
        ${project.artifactId}  
          
              
                org.apache.maven.plugins  
                maven-compiler-plugin  
                  
                    1.8  
                    1.8  
                  
            
            
				org.apache.maven.plugins
				maven-jar-plugin
				
					
						
							com.nxslow.view.XXXApplication
							true
							lib/
						
					
							config/
						
					
					
						*.yml
						*.properties
						*.xml
                        static/**  
                        templates/**  
					
				
			  
              
                org.apache.maven.plugins  
                maven-dependency-plugin  
                  
                      
                        copy-dependencies  
                        package  
                          
                            copy-dependencies  
                          
                          
                            target/lib  
                            false  
                            false  
                            runtime  
                          
                      
                  
              
              
                org.springframework.boot  
                spring-boot-maven-plugin  
                  
                    ZIP  
                      
                          
                            cn.jstars  
                            datatocloud  
                          
                      
                  
              
              
                org.apache.maven.plugins  
                maven-resources-plugin  
                  
                    UTF-8  
                  
              
              
                org.apache.maven.plugins  
                maven-surefire-plugin  
                  
                    true  
                  
              
              
                org.apache.maven.plugins  
                maven-checkstyle-plugin  
                2.17  
                  
                    checkstyle.xml  
                  
              
              
                org.apache.maven.plugins  
                maven-jxr-plugin  
                2.3  
              
          
        
			
				src/main/java
				
					**/*.xml
				
				false
			
			
				src/main/resources
				
					**/*.xml
					**/*.properties
					**/*.yml
				
				
					static/**
					templates/**
				
				${project.build.directory}/config
			
			
				src/main/resources
				
					static/*.*
					templates/**/*.*
				
				${project.build.directory}/
			
		
     
  • 機能:
  •  jar ,
     , 
     com.**.mapper.*.xml xml appName.jar 
    
  • パッケージングに成功した同級ディレクトリの内容
  • /lib
    /static
    /templates
    /config     ( xml,yml,properties )
    appName.jar( jar )
    
  • jarパケット
  • を実行
    java -jar appName.jar( java -jar -Dloader.path=.,lib appName.jar)