1.tomcat-users.xml
ps:eclipse 中Servers 中的文件
<role rolename="manager-gui" /> <role rolename="manager-script" /> <user username="admin" password="admin" roles="manager-gui, manager-script" />
2.项目中的pom.xml
<profiles> <profile> <id>dev</id> <properties> <env>dev</env> <deploy.url>http://localhost:8080/manager/</deploy.url> </properties> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> <profile> <id>test</id> <properties> <env>test</env> </properties> </profile> <profile> <id>product</id> <properties> <env>product</env> </properties> </profile> </profiles> #plugins <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <configuration> <url>http://localhost:8080/manager/text</url> <server>tomcat</server> <path>/</path> <username>admin</username> <password>admin</password> </configuration> <version>1.1</version> </plugin>
3.启动tomcat
4.命令行模式下
cd ${工程根目录} mvn tomcat:redeploy
时间: 2024-11-10 02:11:46