web.xml is missing and <failOnMissingWebXml> is set to true

刚出来的eclipse oxgen 练练手,在使用eclipse创建maven项目的时候,有时候会出现这个问题

web.xml is missing and <failOnMissingWebXml> is set to true

百度了一下原来是resoures/webapp 没有web.xml文件,这时候可以在resoures/webapp 新建一个WEB-INF/web.xml文件 问题就解决了,还有一种方案就是在pom里面加上 

<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>  这个配置问题也能解决,这两种都试过了,都ok了

猜你喜欢

转载自cherrry.iteye.com/blog/2382967