做了个maven聚合项目,好像有了使用maven debug的需求,但其实并没有。
对eclipse下配置maven做一个简单记录:
- 首先pom.xml:
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<server>tomcat</server>
<url>http://localhost:8080/manager/text</url>
<username>tomcat</username>
<password>12345678</password>
<path>/something</path>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
- 然后tomcat-users.xml:
<tomcat-users>
...
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="tomcat" password="12345678" roles="manager-gui, manager-script"/>
...
</tomcat-users>
- 最后eclipse:
Debug As --> Maven Build... --> Goals: tomcat7:run --> Debug
部署时 Goals: tomcat7:deploy
注意:Windows --> Preferences --> Maven --> Installations设置