2
回答
没有 web.xml 如何使用 Maven 打 war 包?
【腾讯云】学生服务器套餐10元/月 >>>   

我使用 Servlet 3 开发了一个 Web 应用,打算采用 Maven 打 war 包。执行 mvn package 命令后,出现如下错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project smart-sample: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

请问应该如何解决?

举报
黄勇
发帖于5年前 2回/5K+阅
顶部