Maven 에서 war file 로 묶을 때 MANIFEST.MF 에 이 archive 의 정보를 넣고 싶어서 방법을 찾아봤다.
- my.war\META-INF\MANIFEST.MF
Manifest 에 정보 추가하기
방법은 그리 어렵지 않다. pom.xml 의 <build> 부분에 <archive> 를 추가해 주면 된다. 자세한 것은 아래 pom.xml 내용을 확인하자.사용법에 관한 자세한 정보는 ref. 2 을 확인하면 된다.
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
...
<!--
version history
v.1.0.3
- email input max-length is extended to 100
-->
<version>1.0.3</version>
<properties>
<pareApiVersion>1.0.x</pareApiVersion>
...
</properties>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
...
<!-- @ref : http://maven.apache.org/shared/maven-archiver/index.html -->
<archive>
<manifestEntries>
<Implementation-Version>${project.version}</Implementation-Version>
<Pare-Api-Version>${pareApiVersion}</Pare-Api-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
MANIFEST.MF
Implementation-Version: v.1.0.3 ... Pare-Api-Version: 1.0.x
Reference
- java - How to put maven project version in war file manifest? - Stack Overflow
- Apache Maven Archiver - Reference
- Apache Maven Archiver - Use Your Own Manifest File
- Maven – Guide to Configuring Plug-ins
댓글 없음:
댓글 쓰기