pom.xml 을 알아보자!

2013. 8. 20. 19:30CM/Maven

반응형

  

 

   오늘은 pom.xml에 대해..알아보자~!  

   maven을 모르겠다는 분은 자바지기 박재성님의 "자바세상의 빌드를 이끄는 메이븐" 책을 추천한다.

 

  pom => project obejct model

 

   기본 뼈대..대충 이러하다!!

 

 <build>

  maven-compiler-plugin : The Compiler Plugin is used to compile the sources of your project.

  출처 : http://maven.apache.org/plugins/maven-compiler-plugin/

 

  maven-dependency-plugin :   The dependency plugin provides the capability to manipulate 

    artifacts. It can copy and/or unpack artifacts from local or remote repositories to a specified

    location.

출처 : http://maven.apache.org/plugins/maven-dependency-plugin/

 

 

maven-eclipse-plugin :

The Eclipse Plugin is used to generate Eclipse IDE files (*.classpath, *.wtpmodules and the .settings folder) for use with a project.

Note: Starting at version 2.6, by default, the generated .classpath now includes "**/*.java" for source directories and excludes "**/*.java" for resource directories. See the example on specifying source path inclusions and exclusions for more details on how to change this behavior.

출처 : http://maven.apache.org/plugins/maven-eclipse-plugin/

 

 

음...작성하다보니 아래의 tag들은 CI에서 사용하면 될 것 같다.

 

 <!--  CM에서 사용 할 plug-in들을 정의 한다. -->
 <build></build>

 <repositories></repositories>

 <distributionManagement></distributionManagement> 
 <scm></scm> 
 <ciManagement></ciManagement>

 

CI Server : 부모 pom.xml

각 모듈 프로젝트 : 자식 pom.xml, 자식 pom.xml

 

자식 pom에서 부모쪽을 상속받아서 사용하면 될 것이다. 즉, 공통적으로 쓰는 내용은 부모pom에!!

<parent></parent> 를 사용하면 될 것이다.

 

ex ) 붉은색 글씨는 부모pom.xml의 내용이다.

       <parent> 엘리먼트를 설정하면 상위 디렉토리에 있는 pom.xml 파일을 부모 pom으로 찾는다.

       경로를 지정하고자 한다면 <relativePath/> 엘리먼트로 pom.xml 경로를 지정 할 수 있다.

 

 마지막으로 플러그인쪽은 아래의 URL을 참조 하면 될 것 같다~

빌드와 레포팅 관련 플러그인에 대해서 나오고 있다.

http://maven.apache.org/plugins/


- END -


 

반응형