mvn jetty:run
mvn jetty:run -Djetty.port=9999
mvn cargo:start
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="admin"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager"/>
<user username="admin" password="admin123" roles="admin,manager,manager-script,manager-gui"/>
mvn cargo:redeploy
systemctl stop firewalld
[ERROR]Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.6.1:redeploy (default-cli) on project manage-admin:Executiondefault-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.6.1:redeploy faile
d:Failed to redeploy [H:workspaceQianduManagemanage-admin argetmanage-admin.war]:The username you provided is not allowed to use the text-based TomcatManager(error 403):Server returned HTTP response code
:403for URL: http://localhost:8080/manager/text/list -> [Help 1]
[ERROR]
[ERROR]To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR]Re-run Mavenusing the -X switch to enable full debug logging.
[ERROR]
[ERROR]For more information about the errors and possible solutions, please read the following articles:
[ERROR][Help1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
需要在Tomcat目录的conf/Catalina/localhost/下新增文件:
manager.xml,内容如下:
<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.6.1</version>
<configuration>
<container>
<containerId>tomcat8x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.hostname>10.110.2.161</cargo.hostname>
<cargo.remote.username>admin</cargo.remote.username>
<cargo.remote.password>admin123</cargo.remote.password>
<cargo.tomcat.manager.url>http://10.110.2.161:8080/manager</cargo.tomcat.manager.url>
</properties>
</configuration>
</configuration>
</plugin>