“需要 webxml 属性"Maven 中的错误 [英] "webxml attribute is required" error in Maven

查看:21
本文介绍了“需要 webxml 属性"Maven 中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误:

错误组装 WAR:需要 webxml 属性(如果在更新模式下执行,则需要预先存在的 WEB-INF/web.xml)

Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)

我有 web.xml 在正确的位置,它是 projectnamesrcmainwebappWEB-INFweb.xml

I have got web.xml in right place which is projectnamesrcmainwebappWEB-INFweb.xml

这可能是什么原因造成的?

What could be causing this?

推荐答案

如果你能提供你的 maven-war-plugin 的代码片段会很有帮助.看起来 web.xml 在正确的位置,您仍然可以尝试明确给出位置

It would be helpful if you can provide a code snippet of your maven-war-plugin. Looks like the web.xml is at right place, still you can try and give the location explicitly

<plugin>            
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <configuration>
    <webXml>srcmainwebappWEB-INFweb.xml</webXml>        
  </configuration>
</plugin>

这篇关于“需要 webxml 属性"Maven 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆