콘텐츠로 건너뛰기

pom.xml 에서 properties 사용하기 : maven


maven 빌드에 CheckStyle 과 PMD 같은 분석툴을 붙이다보니 pom.xml 이 지저분해지고 있다.

특히 RuleSet을 지정해야 하는 경우에 pom.xml 자체에 경로가 들어가게 되어 추후에 수정이 복잡할 거다.

이럴 때 위의 사항에서 5번 케이스를 적용하면 된다.

properties 태그에 해당 태그를 추가해서 ${ }로 불러다가 쓰면 좋다.

업데이트 해야될 내용이 properties에 모여 있으면, 탐색해서 수정하기 편할 것 같다.

<properties>
<checkStyleRuleSet>${basedir}/CheckStyle_RuleSet_090512.xml</checkStyleRuleSet>
</properties>

이렇게 정해주면, pom.xml 내 어디서든지 ${checkStyleRuleSet} 으로 value를 호출하여 사용할 수 있다.

출처 : http://maven.apache.org/pom.html#Properties

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다