大家好,又见面了,我是全栈君。
使用版本解压tomcat可以方便查看tomcat的后台输出的出错信息,便于调试。
将tomcat安装文件夹下的/config/tomcat-user.xml改动为例如以下:
<?
上面配置文件的作用是,给tomcat加入一个用户名为“username”,密码为“password”。权限为“manager-gui”的用户。
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<username>username</username>
<password>password</password>
<path>/${project.artifactId}</path>
</configuration>
</plugin>
</plugins>
假设使用eclipse的话,就右键项目->Run As->Maven build…->在Goals里面输入tomcat7:deploy; 假设直接使用Maven的话就运行命令:
mvn tomcat7:deploy
版权声明:本文博客原创文章,博客,未经同意,不得转载。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/117302.html原文链接:https://javaforall.cn