java - Maven can't find web.xml -
i'm getting following error when building maven-project command mvn clean install
[error] failed execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project myproject: error assembling war: webxml attribute required (or pre-existing web-inf/web.xml if executing in update mode)
i have web.xml in project. in folder web/web-inf/web.xml
i using intellij idea. can avoid problem adding following pom.xml:
<build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-war-plugin</artifactid> <configuration> <failonmissingwebxml>false</failonmissingwebxml> </configuration> </plugin> </plugins> </build>
but i'd know why maven claims web.xml missing though it's not , in default location when creating new web application project in intellij idea.
your problem have web.xml
in path: web/web-inf/web.xml
with maven, web.xml
should go in src/main/webapp/web-inf
or should change webxml
configuration of war plugin (see here: https://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#webxml)
Comments
Post a Comment