1. 在配置好eclipse + tomcat7 中的server创建, 想把maven project web项目 加到server. 可是会出现maven project 是会有没有resource 加到tomcat server中。(跟以前web app 直接publish 到tomcat server是不同的
2. 现在只能通配置 项目中的pom.xml来启动deploy tomcat中
3.
a 主要原理是启动了tomcat后(不管是通过startup.bat还是eclipse的服务器启动)
b. 然后运行pom.xml, 把maven project项目打包deploy到启动tomcat服务.
c. eclipse + tomcat服务器配置中..要配置tomcat服务器的server location 使用 Use Tomcat installation(take control of Tomcat installation)
4. 把主要配置文件贴上:
a. maven/conf/settings.xml
<server>
<id>tomcat</id>
<username>admin</username>
<password>password</password>
</server>
b. tomcat7/conf/tomcat-users.xml
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<!-- <user username="tomcat" password="tomcat" roles="tomcat"/>-->
<user username="admin" password="password" roles="manager-gui,manager-script,manager-jmx,admin-gui,admin-script"/>
<!--<user username="role1" password="tomcat" roles="role1"/>-->
c. ${app.project}/pom.xml
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>tomcat</server>
</configuration>
</plugin>
</plugins>