War文件未与Jenkins正确部署

时间:2017-09-11 04:49:49

标签: maven tomcat jenkins build war

使用Jenkins,My Build已成功完成并使用了Git的源代码管理。我正在使用maven来构建我的项目。但war文件未正确部署。 Tomcat users.xml文件包含以下内容:

<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="admin" roles="manager-gui,manager-script"/>

这是错误的堆栈跟踪:

**

[INFO] Building war: /root/.jenkins/workspace/First Maven project/target/hfcl.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.329s
[INFO] Finished at: Fri Sep 08 16:49:20 IST 2017
[INFO] Final Memory: 31M/279M
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /root/.jenkins/workspace/First Maven project/pom.xml to HFCL/HFCL/0.0.1-SNAPSHOT/HFCL-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /root/.jenkins/workspace/First Maven project/target/hfcl.war to HFCL/HFCL/0.0.1-SNAPSHOT/HFCL-0.0.1-SNAPSHOT.war
channel stopped
Deploying /root/.jenkins/workspace/First Maven project/target/hfcl.war to container Tomcat 8.x Remote with context HFCL
  [/root/.jenkins/workspace/First Maven project/target/hfcl.war] is not deployed. Doing a fresh deployment.
  Deploying [/root/.jenkins/workspace/First Maven project/target/hfcl.war]
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to deploy [/root/.jenkins/workspace/First Maven project/target/hfcl.war]
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:106)
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:184)
    at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
    at hudson.FilePath.act(FilePath.java:998)
    at hudson.FilePath.act(FilePath.java:976)
    at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
    at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:682)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:627)
    at hudson.model.Run.execute(Run.java:1764)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:542)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:419)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - Deployed application at context path [/HFCL] but context failed to start
" instead of the expected "OK" message
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:715)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:761)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:312)
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:101)
    ... 18 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - Deployed application at context path [/HFCL] but context failed to start
" instead of the expected "OK" message
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:715)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:761)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:312)
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:101)
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:184)
    at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
    at hudson.FilePath.act(FilePath.java:998)
    at hudson.FilePath.act(FilePath.java:976)
    at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
    at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:736)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:682)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:627)
    at hudson.model.Run.execute(Run.java:1764)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:542)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:419)
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE

**
Tomcat for jenkins中的配置如下:

enter image description here

任何人都可以建议我缺少什么吗?

0 个答案:

没有答案