私はプロジェクト内のweb.xmlを持っているコマンドmvn clean install
Mavenのは、web.xml
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war
(default-war) on project MyProject:
Error assembling WAR: webxml attribute is required (or pre-existing
WEB-INF/web.xml if executing in update mode)
と私のMavenプロジェクトをビルドするときに、私は次のエラーを取得していますを見つけることができません。フォルダ内web/WEB-INF/web.xml
私はIntelliJ IDEAを使用しています。私はのpom.xmlに以下を追加することによって、この問題を回避することができます
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
をしかし、私はMavenのはそれがないにもかかわらず、web.xmlファイルが欠落していると主張している理由を知りたいと作成するとき、それはデフォルトの場所にありますIntelliJ IDEAの新しいWebアプリケーションプロジェクトです。 Mavenのでweb/WEB-INF/web.xml
、web.xml
はsrc/main/webapp/WEB-INF
に行くべきか、戦争プラグインのwebXml
設定を変更する必要があります(ここを参照してください:https://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#webXmlを)あなたの問題は、あなたがこのパスでweb.xml
を持っているということです
WEB-INF/web.xmlとプロジェクトルートディレクトリの間にWebディレクトリが存在しないようにするため、path web/WEB-INF/web.xmlはデフォルトではありません。 –
web-folderからWEB-INFをプロジェクトルートに移動しても、同じエラーが発生します。 –
はsrc/main/webapp/WEB-INFのweb.xmlですか? –