Maven快速搭建可debug的java web工程

前提:eclipse上已经安装Maven插件 eclipse-maven3-plugin。

web环境Build:

1. Convert to Java Dynamic Web Project

Project-->properties-->Project Facets,click "Convert to faceted from...",select the "Dynamic web modules" and "Java" option,click "Further configuration available...",modify "Content directory" set "/src/main/webapp"(Maven project web directory),select the "Generate web.xml deployment descriptor" option, then click "apply".

 

2. Modify Deployment Assembly

Project-->Properties-->Deployment Assembly-->Add-->Java Build Path Entries(Referenced Projects Classpath Entries:eclipse--helios)-->Maven Dependencies.

 

3. Config Server Apache Tomcat

Show view-->Servers-->new Server wizard-->Choose tomcat server 7.0-->Choose deploy project.

Server View-->modify project deploy directory to tomcat installtion directory(-->modify module path:options-->close "Auto reloading enabled" option)-->tomcat server-->clean

 

4. Config tomcat

Show View-->Servers-->Server options-->Publish modual contexts to separat XML files

 

5. Reset Project WebContent

可以把project目录的.settings目录删除,Project-->refresh,然后Project-->Project Facets-->Select "Java" and "Dynamic Web Module"-->Further Configuration availabe.

 

6. Maven Clean

pom.xml-->clean

pom.xml-->install

 

7. Servers-->Tomcat-->Clean

 Server-->Debug

 

Reference blog:

http://zk1878.iteye.com/blog/1222330

你可能感兴趣的:(Java Web)