先日書いたエントリではmaven-replacer-pluginを使って・・・なんて書いてましたが、標準のmaven-resources-pluginでより簡単に複数のトークン、ファイルに対して使えることに気づいたので、こちらの方法を取ると良いです。こちらの方法だと、POMファイル内で参照可能な変数は全て利用することが可能なので、色々なことが出来ます。 構成はこんな感じで。
project
|-src/main/java
| :
+-src/filtering-resources
| |-WEB-INF/appengine-web.xml
|-pom.xml
appengine-web.xml
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>${appId}</application>
<version>${appVersion}</version>
<sessions-enabled>true</sessions-enabled>
<ssl-enabled>true</ssl-enabled>
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties" />
<property name="com.google.gdata.DisableCookieHandler" value="true" />
</system-properties>
</appengine-web-app>
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">
:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<appId>appId</appId>
<appVersion>version</appVersion>
</properties>
:
<build>
:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-appengine-web-xml</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>war</outputDirectory>
<resources>
<resource>
<directory>src/filtering-resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
:
</project>
0 コメント:
コメントを投稿