问题描述
我正在使用Jenkins部署插件来部署到Tomcat.生成的.war文件使用以下格式命名:MyApp ## [version].[buildnumber] .war
I am using the Jenkins deploy plugin to deploy to Tomcat. The .war file that gets generated is named using the following format: MyApp##[version].[buildnumber].war
例如,war文件将生成为:MyApp ## alpha.13.war
For example, the war file will be generated as: MyApp##alpha.13.war
文件名中散列的原因是Tomcat管理器html页面在已部署的应用程序的版本"列中列出了版本.这样,我们可以再次检查当前已部署到Tomcat的版本.
The reason for the hashes in the filename is for Tomcat manager html page to list the version in the version column of the deployed applications. This way, we can double check which version is currently deployed to Tomcat.
现在,当第二次尝试通过Jenkins进行部署时,内部版本号显然会增加.因此,上面的war文件将以文件名MyApp ## alpha.14.war
Now when trying to deploy via Jenkins for a second time, the build number obviously increases. So the above war file will be generated with the file name: MyApp##alpha.14.war
此操作现在失败,但出现以下异常:
This now fails with the below exception:
在 org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566) 在 org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:480) 在 org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:420) 在 org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:62) 在 org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:130) ...另外17个 org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: 失败-路径/TaskFormBuilder##alpha.21
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:480) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:420) at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:62) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:130) ... 17 more org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - No context exists for path /TaskFormBuilder##alpha.21
在 org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566) 在 org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:480) 在 org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:420) 在 org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:62) 在 org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:130) 在 org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:178) 在 hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73) 在 hudson.plugins.deploy.CargoContainerAdapter $ 1.invoke(CargoContainerAdapter.java:116) 在 hudson.plugins.deploy.CargoContainerAdapter $ 1.invoke(CargoContainerAdapter.java:103) 在hudson.FilePath.act(FilePath.java:919)处 hudson.FilePath.act(FilePath.java:897)在 hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103) 在 hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61) 在hudson.tasks.BuildStepMonitor $ 3.perform(BuildStepMonitor.java:45) 在 hudson.model.AbstractBuild $ AbstractBuildExecution.perform(AbstractBuild.java:770) 在 hudson.model.AbstractBuild $ AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) 在hudson.model.Build $ BuildExecution.post2(Build.java:183)处 hudson.model.AbstractBuild $ AbstractBuildExecution.post(AbstractBuild.java:683) 在hudson.model.Run.execute(Run.java:1784)处 hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)在 hudson.model.ResourceController.execute(ResourceController.java:89) 在hudson.model.Executor.run(Executor.java:240)处完成:失败
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:480) at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:420) at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:62) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:130) at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:178) at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116) at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103) at hudson.FilePath.act(FilePath.java:919) at hudson.FilePath.act(FilePath.java:897) at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103) at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61) at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683) at hudson.model.Run.execute(Run.java:1784) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Finished: FAILURE
任何人都可以使用tomcats建议的命名约定(使用哈希值来指定版本)让Jenkins将战争文件重新部署到Tomcat吗?
Can anyone assist with how to get Jenkins to re-deploy a war file to Tomcat using tomcats suggested naming convention (using hashes so specify the version) ?
推荐答案
我认为您会发现部署确实有效,只是报告了错误.
I think you'll find the deployment actually works, it just reports the error.
这是部署程序插件或货物代码中的错误,请参见JIRA问题 https://issues.jenkins-ci.org/browse/JENKINS-19564 .
This is a bug in the deployer plugin or cargo code see JIRA issue https://issues.jenkins-ci.org/browse/JENKINS-19564.
这篇关于重新部署“版本化"的产品. Jenkins到Tomcat的war文件失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!