[Maven] profile 이용하기

[Desc]

서버 환경별로 빌드시 달리하고 싶을 경우 적용


[설정]

//dependencis 가 끝나는 곳에 profiles 추가
//현재 나는 resources라는 profile에 변수를 추가 했습니다.
  
 
  
   local
   
             true
         
   
    resources_local
      
  
  
   dev
   
    resources_stg
      
  
  
   stg
   
    resources_stg
      
  
  
   op
   
    resources_op
      
  
 
// 빌드시에 환경 설정에 따른 설정값을 읽어오도록 profile변수 resources변수를 넣어 주었습니다.

  
   
    src/main/java
    
     **/**
    
    true
   
   
   
    ${resources}/properties
    
     **/AccountResources*.properties
     ../**/ehcache.xml
    
      
   
    ${resources}
    
     **/ehcache.xml
    
      
  
  
   
   
    org.apache.maven.plugins
    maven-surefire-plugin
    2.7.1
    
     
      -Xms256m -Xmx512m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8
     
    
   
   
   
    maven-compiler-plugin
    3.1
    
     1.7
     1.7
    
   
   
   
    maven-war-plugin
    2.4
    
     *.html, *.js, *.css, *.txt, image/**
     false
    
   
   
   
    org.apache.maven.plugins
    maven-assembly-plugin
    2.5.4
    
     
      assembly_webStaticFile.xml
     
    
    
     
      bin
      package
      
       single
      
     
    
   
   
    org.apache.maven.plugins
    maven-antrun-plugin
    1.1
    
     
      prepare-package
      
       run
      
      
       
        Set properties
        
              
        
        
         
          
          
         
                
       
      
     
    
   
  
 


젠킨스 빌드시에 -P [profile추가]



<!-- maven 한글깨짐 방지 -->

   <plugin>

    <groupId>org.apache.maven.plugins</groupId>

    <artifactId>maven-surefire-plugin</artifactId>

    <version>2.7.1</version>

    <configuration>

     <argLine>

      -Xms256m -Xmx512m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8

     </argLine>

    </configuration>

   </plugin>

이부분을 추가하게 되면 junit test코드작성하여 실행시에 console에서 한글 깨짐을 방지 할수 있습니다.






'Framework & ORM > Build Tools' 카테고리의 다른 글

[Maven, Gradle] ojdbc6 설정  (2) 2018.01.18
[Maven] maven-shade-plugin 의존관계설정  (0) 2018.01.11
Maven, Gradle Nexus서버 설정  (0) 2018.01.11
블로그 이미지

pstree

pstree.. process...

,