zoukankan      html  css  js  c++  java
  • web.xml is missing and <failOnMissingWebXml> is set to true

    在学习maven模块化构建项目的时候遇到了如下报错信息:

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

    。这时候需要右击项目——>Java EE Tools——>Generate Deployment Descriptor Stub.然后系统会在src/main/webapp/WEB_INF文件加下创建web.xml文件。错误解决!

    当然这个方法是针对web项目的解决方案,如果你的工程不是web项目,那么还有另外一种解决方案,就是在pom文件中配置一下failOnMissingWebXml。具体配置如下:

    复制代码
    <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>
    复制代码
  • 相关阅读:
    将Excel嵌入你的.Net程序
    调用资源文件
    Socket Error# Description
    LPCTSTR 和其它
    linux send and recv详解
    stdafx.h的作用
    setsocketopt() usage
    openfire源码入门级分析
    openfire分析
    关于xmpp
  • 原文地址:https://www.cnblogs.com/javahr/p/8341512.html
Copyright © 2011-2022 走看看