Maven远程部署web工程到Tomcat7中

tomcat-users.xml文件中如下配置:

  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <user username="freebird" password="123456" roles="manager-gui, manager-script" />


Maven工程中pom.xml文件如下配置:

      <plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>tomcat-maven-plugin</artifactId>
	<configuration>
	  <url>http://192.168.1.200:8080/manager/text</url>
	  <server>test</server>
	  <path>/MyService</path>
	</configuration>
      </plugin>

在~/.m2/settings.xml文件中如下配置:

<?xml version="1.0" encoding="UTF-8"?>
<settings>
  <servers>
    <server>
      <id>test</id>
      <username>freebird</username>
      <password>123456</password>
    </server>
  </servers>
</settings>

执行:

mvn tomcat:deploy




你可能感兴趣的:(maven,tomcat,Web,server,encoding)