src/main/webappの一部のリソースをWARから除外したい
src/main/webapp/index.jspがテスト用の簡易メニューになっており、本番環境では別のメニューを使用するのでこれをWARから取り除きたい。
pom.xml
<profiles> <profile> <id>development</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <war.excludes>""</war.excludes> </properties> </profile> <profile> <id>production</id> <properties> <war.excludes>index.jsp</war.excludes> </properties> </profile> </profiles> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <excludes>${war.excludes}</excludes> </configuration> </plugin> </plugins> </build>
開発用$ mvn clean package 本番用$ mvn -Pproduction clean package
単に「""」に該当するリソースがなくて無視されているだけかもしれない…。