给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 點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦