Maven

pom.xml Plugin execution not covered by lifecycle configuration 오류

앞에서 mave timestamp 의 TimeZone 변경을 위해서 build-helper-maven-plugin 를 사용했는데 Eclipse 에서 다음과 같이 오류가 난다. 위 오류내용은 다음과 같다. Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin: 1.11:timestamp-property (execution: timestamp-property, phase: validate) Eclipse 는 오류를 표시했지만 maven 은 정상적으로 동작한다. 이는 Ecliplse 의 m2e 커넥터의 lifecycle mapping 정보를 명확하게 해야하는데 이것이 없어서 오류로 표시하는 것이다. 다음 URL 에 관련 내용이 있다. M2E_plugin_execution_not_covered 내용을 보면 <pluginManagement> 를 이용해서 lifecycle-mapping 을 설정해주어야 한다. 위 내용을 기반으로  build-helper-maven-plugin 의 execution 에 대해서 mapping […]

Maven

Maven timestamp 에 timezone 변경하기

maven 은 build timestamp 를 변수로 지원한다. 하지만 자세히 보면 이 timestamp 는 UTC timezone 에 맞춰져 있다. maven 에서 timestamp 는 기본적으로 UTC timezone 을 기반으로 한다. 그런데 이것을 다른 timezone 으로 변경할려면 어떻게 해야할까? build-helper-maven-plugin maven 에선 많은 plugin 을 지원한다. build-helper-maven-plugin 은 우리가 필요하는 기능인 timestamp 에 timezone 변경을 지원한다. 변경된 timezone 의 시간을 표시할 변수와 timestamp format, timezone 등을 지정하면 여기서 지정한 변수를 사용할 수 있게 된다.

위와같이 current.time 변수에 한국시간의 timezone 으로 지정한 timestamp […]

Maven

war 파일이름에 TimeStamp 찍기

Maven 을 이용하면 자동으로 컴파일을 해주고 war 파일로 만들어 준다. 그런데, 이때에 war 파일에 TimeStamp 를 찍을 수 있다. war  파일명이 project.name-timestamp.war 형식으로 파일을 작성하도록 할수 있다. 방법도 대략 두가지 방법이 있다. maven 자체 기능 maven 3.0 이상이라면 자체 기능을 이용할 수 있다. properties 에 timestamp 와 maven.build.timestamp.format 을 지정하고 build 영역에서 파일명을 지정해주면 된다. 예를들면 다음과 같다.

위와같이 설정하고 maven build 를 하면 다음과 같이 출력되는 것을 볼수가 있다.

maven-war-plugin 으로 war 파일명 지정 이것은 사실 위 […]