Maven project export War package

1. Configure pom.xml, in the overview window, configure packaging as war

2. Solve the error: web.xml is missing and <failOnMissingWebXml> is set to true

Add the following to the pom.xml file

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

3. Right-click on the project and execute Maven->Update

4. Right-click on the project and execute Run As->Maven install

5. If you need to import jar packages from non-Maven warehouses, add the following configuration

        <dependency>
		    <groupId>org.apache</groupId>
		    <artifactId>test</artifactId>
		    <version>1.0</version>
		    <scope>system</scope>
		    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/taobao-sdk-java-auto_1455552377940-20160607.jar</systemPath>
		</dependency>

6. If the files in the war package are not updated, delete the classes directory under WEB-INF, and compile the files here before configuring.

7. The files under tomcat are not updated because the configuration file of tomcat has been modified

<Context docBase="D:\www\antsclub" path="" reloadable="true"/></Host>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325561084&siteId=291194637