민서네집

pom.xml 에 ${project.basedir} 사용하기. 본문

Java

pom.xml 에 ${project.basedir} 사용하기.

브라이언7 2013. 7. 16. 14:20

system scope를 가진 dependency 를 pom.xml 에 추가하면서 systemPath 를 설정해야 했는데, 절대경로가 들어가서, 개발자마다 workspace 가 틀리면 문제가 된다.


               <dependency>

<groupId>log4sql</groupId>

<artifactId>log4sql</artifactId>

<version>0.0.1-SNAPSHOT</version>

<scope>system</scope>

<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/log4sql.jar</systemPath>

</dependency>


위와 같이, ${project.basedir} 라는 환경변수를 사용하면 무척 편하다.


[참고] http://maven.apache.org/guides/introduction/introduction-to-the-pom.html


Special Variables
project.basedirThe directory that the current project resides in.
project.baseUriThe directory that the current project resides in, represented as an URI. Since Maven 2.1.0
maven.build.timestampThe timestamp that denotes the start of the build. Since Maven 2.1.0-M1


Comments