If you encounter a maven error on your pom file saying web.xml is missing

来源:互联网 发布:wii 知乎 编辑:程序博客网 时间:2024/06/01 18:56

If you encounter a maven error on your pom file saying web.xml is missing

if you encounter a maven error on your pom file saying web.xml is missing 

and <failOnMissingWebXml> is set to true, then it means it is expecting a web.xml file in your Maven project

 because it is a web application, as we have chosen packaging as war. However, nowadays in web applications

 web.xml file is optional. Add the following configuration in your pom.xml within <project> tag to fix the error:

<build>    <plugins>        <plugin>            <groupId>org.apache.maven.plugins</groupId>            <artifactId>maven-war-plugin</artifactId>            <version>2.6</version>            <configuration>             <failOnMissingWebXml>false</failOnMissingWebXml>            </configuration>        </plugin>    </plugins></build> 



Packt.Spring.MVC.Beginners.Guide.2nd.Edition.B01I9PAB2O


阅读全文
1 1
原创粉丝点击