Article source: blog.csdn.net/lucklq/arti…

The default deployment directory of Eclipse Web projects to Tomcat is in the project space. This article aims to change the deployment directory to the Tomcat installation directory and solve the dependency package output problem.



1. Add the Tomcat server to Eclipse.







2. Publish the Web project to Tomcat:





Select the newly added Tomcat:







Eclipse automatically generates the Servers project:









3. In the Servers view, Remove deletes the project just published:









4. Open the Tomcat server configuration item:









5. Modify the following configuration items to keep Tomcat running. Otherwise, the Server Locations column becomes gray and becomes unavailable:







6. Configure the lib output.



Project right click:







Click Next, select the package you want to publish to Tomcat with your project, and complete the confirmation operation.







7. Modify the. Classpath file of the project and bring the following configuration items to the front of the project. Otherwise, the files previously published in web-INF will be overwritten when publishing the project:







8. Just republish the project. Eclipse – right-click – project -Run as-run on Server. In this case, the project will be deployed in the Tomcat installation directory

C:\Program Files\apache-tomcat-7.0.70\conf\server. XML can find new contents such as <Context.\