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

來源:互聯網
上載者:User

標籤:建立項目   提示   details   lis   UI   lisp   並且   and   sse   

參考:http://blog.csdn.net/liuvlun/article/details/50218507

使用maven建立項目時有時在pom.xml的war處出現failOnMissingWebXml的錯誤,根據錯誤提示的原因可以知道項目是web項目,打包時打成war包。

如果項目裡沒有web.xml,在項目裡添加一個web.xml,重新整理一下項目,就應該沒有錯誤,如果還有請看下面的介紹

 如果你的項目在 /src/main/webapp/WEB-INF 下有web.xml,但是仍然還是報這個錯誤,需要兩步操作

1)右擊項目,開啟Properties對話方塊,點擊Deployment Assembly選項,在右邊添加一個檔案夾,並且儲存設定

    2)在eclispe上方點擊Project ->Clean 清理一下這個項目

經過這兩步錯誤就應該已經清楚了

 

或者是

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

 

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.