Jenkins tomcat7部署错误 [英] Jenkins tomcat7 deploying error
问题描述
我有一个名为'SampleMavenDeploy1'的詹金斯工作,可以将工件(war文件,pom.xml)从上游项目('SampleMavenBuild1')成功复制到该项目中.
I have a jenkins job named 'SampleMavenDeploy1' which copies artifacts(war file,pom.xml) from upstream project('SampleMavenBuild1') successfully to this project.
我对此项目有以下配置:
I have following configuration for this project:
"
构建步骤:
Copy artifacts from another project
Project Name:SampleMavenBuild1
构建后操作
War/Ear files:MavenWebAppV14/target/*.war
Context Path:webapps
Containers:
Tomcat7.x
Manager username:tomcat
Manager Password:tomcat
Tomcat Url:http://localhost:8080/manager/text
"
SampleMavenBuild1(制作Maven项目的war文件)的构建已成功.在此作业(SampleMavenDeploy1)的工作区中,有战争文件(MavenWebAppV14/target/MavenWebAppV14.war).我还配置了tomcat-users.xml,以添加用户名"tomcat",密码"tomcat"以及角色分别为"manager-gui"和"manager-script"的用户.
The build of SampleMavenBuild1(make war file of a maven project) has succeeded. In workspace of this job (SampleMavenDeploy1), there is war file (MavenWebAppV14/target/MavenWebAppV14.war). I have also configured tomcat-users.xml to add user of username 'tomcat' , password 'tomcat' and roles as 'manager-gui' and 'manager-script' .
我在工作的詹金斯构建中面临以下错误.此作业旨在通过CI服务器在tomcat7上部署War文件.我还在jenkins中安装了部署到tomcat"插件.
I am facing following errors in a jenkins build of a job. This job is designed for deploying war file on tomcat7 via CI server. I have also 'deploy to tomcat' plugin installed in jenkins.
由用户vikas发起
Building in workspace C:\Users\vikachou\.jenkins\jobs\SampleMavenDeploy1\workspace
Copied 2 artifacts from "SampleMavenBuild1" build number 4
Deploying C:\Users\vikachou\.jenkins\jobs\SampleMavenDeploy1\workspace\MavenWebAppV14\target\MavenWebAppV14.war to container Tomcat 7.x Remote
ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [C:\Users\vikachou\.jenkins\jobs\SampleMavenDeploy1\workspace\MavenWebAppV14\target\MavenWebAppV14.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:189)
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:918)
at hudson.FilePath.act(FilePath.java:896)
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:1770)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unknown command /manager/text/list
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
... 16 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unknown command /manager/text/list
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:686)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:699)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:174)
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:918)
at hudson.FilePath.act(FilePath.java:896)
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:1770)
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
任何能弄清楚的人都将受到欢迎. 预先谢谢!!!
Anyone who can figure out is most welcomed . Thanks in advance!!!
推荐答案
您需要为文本管理器授予权限才能进行部署.
You need to give permissions to the text-manager to be able to deploy.
只需转到tomcat-users.xml并添加以下内容:
Just go to tomcat-users.xml and add this:
<user username="tomcat" password="password" roles="manager-script"/>
或者仅将manager-script
权限授予您现有的tomcat-manager用户
Or just give the manager-script
permission to your existing tomcat-manager user
这篇关于Jenkins tomcat7部署错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!