在Jenkins中部署WAR时出错

时间:2017-07-28 04:16:29

标签: tomcat jenkins

尝试使用Jenkins部署WAR时出现以下错误。

Started by user anoop
[EnvInject] - Loading node environment variables.
Building in workspace C:\Users\anoop\.jenkins\workspace\AutomatedDeploymentTest
Deploying C:\Users\anoop\.jenkins\workspace\AutomatedDeploymentTest\sample.war to container Tomcat 7.x Remote
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\Users\anoop\.jenkins\workspace\AutomatedDeploymentTest\sample.war]
 at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:189)
 at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
 at 
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:2)

在conf / tomcat-user中,请添加以下内容:

<user username="anoop" password="yourpassword" roles="manager-script"/>

在詹金斯,请添加以下内容,

EAR/WAR file: **/*.war
context path: sample
Tomcat URL : http://localhost:8080