这是tomcat配置
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.15</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.tomcat.manager.url>http://url:8080/manager</cargo.tomcat.manager.url>
<cargo.remote.username>tomcat_user</cargo.remote.username>
<cargo.remote.password>123456</cargo.remote.password>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.hostname>url</cargo.hostname>
<cargo.tomcat.ajp.port>8009</cargo.tomcat.ajp.port>
</properties>
</configuration>
</configuration>
</plugin>
这是pom配置
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< com.masaya.maven:maven-10-deploy-remote >---------------
[INFO] Building maven-10-deploy-remote 1.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- cargo-maven2-plugin:1.4.15:deploy (default-cli) @ maven-10-deploy-remote ---
[INFO] [edDeployerDeployMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-tomcat:jar:1.4.15 for container tomcat7x
[INFO] [mcat7xRemoteDeployer] Deploying [E:\class\maven\project\maven-workspace\maven-10-deploy-remote\target\maven-10-deploy-remote.war]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.372 s
[INFO] Finished at: 2021-07-18T18:55:19+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.15:deploy (default-cli) on project maven-10-deploy-remote: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.15:deploy failed: Failed to deploy [E:\class\maven\project\maven-workspace\maven-10-deploy-remote\target\maven-10-deploy-remote.war]: The username and password you provided are not correct (error 401): Server rejected operation -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using 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] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
进程已结束,退出代码为 1
这是maven日志
想问下你的配置:<cargo.hostname>url</cargo.hostname>,是不是问了模糊关键词使用url代替的。这里的标签地址必须配置,不配置的话默认是localhost。
1、配置完成后先执行下命令:mvn cargo:redeploy
2、另外检查下你的网络或者路由,看下是否会出现jar的下载不到的情况。
若有帮助,记得采纳。