#navi_header|Java|
Mavenのwarパッケージングで、
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')
という警告が出ました。Antのwarタスクでも同じ警告が出てしまう場合があるようです。
手許で確認した限りでは、archetypeとして org.codehaus.mojo.archetypes:webapp-jee5 (1.3) の構成で"mvn package" すると同警告が表示されました。
環境:
#pre||>
> mvn -version
Apache Maven 3.0.4 (r1232337; 2012-01-17 17:44:56+0900)
Maven home: C:\in_vitro\apps\apache-maven-3.0.4\bin\..
Java version: 1.6.0_22, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_22\jre
Default locale: ja_JP, platform encoding: MS932
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
> mvn help:effective-pom
...
maven-war-plugin
2.1.1
default-war
package
war
...
||<
これを解決するには、maven-war-plugin の2.2を使います。
pom.xml:
#pre||>
...
org.apache.maven.plugins
maven-war-plugin
2.2
...
||<
警告ではなく、以下のINFOメッセージが表示されるようになりました。
[INFO] WEB-INF\web.xml already added, skipping
警告でもINFOメッセージでも、
src/main/webapp/WEB-INF/web.xml
が
target/(artifactId)-(version)/WEB-INF/web.xml
にコピーされ、最終的にwarに含まれるので動作自体には影響ありませんが、警告が表示されるのが気になってしまう場合はためしてみると良いでしょう。
なおでweb.xmlを指定する方法もweb上で紹介されていますが、2.2の前の2.1.1で試したところを指定しても警告は消えませんでした。
#pre||>
...
org.apache.maven.plugins
maven-war-plugin
2.1.1
src/main/webapp/WEB-INF/web.xml
...
||<
Antのwarタスクでも同じような警告が出るらしいので、maven-war-plugin自体と言うよりはwarパッケージングのライブラリの問題かもしれません。
参考:
- war:war
-- http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html
- [#MWAR-248] Plugin warns about missing webxml attribute even if one exists - jira.codehaus.org
-- http://jira.codehaus.org/browse/MWAR-248
- java - Disable Maven warning message - "Selected war files include a WEB-INF/web.xml which will be ignored" - Stack Overflow
-- http://stackoverflow.com/questions/4342245/disable-maven-warning-message-selected-war-files-include-a-web-inf-web-xml-wh
- Ant - Users - What does the warning "selected war files include a WEB-INF/web.xml which will be ignored" mean?
-- http://ant.1045680.n5.nabble.com/What-does-the-warning-quot-selected-war-files-include-a-WEB-INF-web-xml-which-will-be-ignored-quot-m-td1349858.html
- java - Eclipse WebApp deploying over Maven with Tomcat results in Error: 'Failed to deploy application at context path' - Stack Overflow
-- http://stackoverflow.com/questions/6329017/eclipse-webapp-deploying-over-maven-with-tomcat-results-in-error-failed-to-dep
#navi_footer|Java|