给tomcat配置用户名密码##
在tomcat文件夹中conf文件夹的tomcat-users.xml中进行配置
<?xml version='1.0' encoding='cp936'?><tomcat-users><role rolename="manager-gui"/> <role rolename="manager-script"/> <user username="username" password="password" roles="manager-gui,manager-script"/></tomcat-users>
在maven工程的pom.xml中添加如下代码##
<build>
<pluginManagement>
<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>
</pluginManagement>
<finalName>maven2</finalName>
</build>部署应用##
->Run As->Maven build…->在Goals里面输入tomcat7:deploy
注意:部署之前一定要把tomcat打开。
然后在浏览器中输入http://localhost:8080/maven2/就可以访问了。
作者:ythmilk
链接:https://www.jianshu.com/p/b79841f4aec8
点击查看更多内容
为 TA 点赞
评论
共同学习,写下你的评论
评论加载中...
作者其他优质文章
正在加载中
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦