Maven cannot find web.xml when packaging javaweb application

the project structure is like this.

pom.xml:


maven buildweb.xml


configuration:


:


:


Project Facets,:

all report the same error.

only when you change the WebContent of the project to webapp and put it under src/main/, can you successfully package
ask for advice!

Sep.07,2021

the role of web.xml

 servletweb.xml,web.xmlspring,spring,Servletweb.xml;
 Servlet X(),web.xml,tomcat;
   

Plan 1: use web.xml to guide

1.webapp,web.xml,maven-war-plugin,warwartomcat;

Plan 2: use embedded web containers

<build>
 <plugins> <!--tomcat-->
    <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration> 
            <path>/</path> <!--  :localhost:9090, aalocalhost:9090/aa -->
            <port>9090</port>
            <uriEncoding>UTF-8</uriEncoding><!--  -->
        </configuration>
    </plugin>
 <!--war-->
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.1.0</version>
     </plugin> 
  </plugins>
 </build>

to add embedded tomcat plug-ins and upgrade maven-war-plugin;
maven-war-plugin to follow the servlet specification!

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e580b9-441b3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e580b9-441b3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?