简体   繁体   English

Jenkins 部署插件失败

[英]Jenkins Deploy Plugin failing

When I tried to deploy war from Jenkins using I am getting the following exception in Jenkins job log.当我尝试使用 Jenkins 从 Jenkins 部署战争时,我在 Jenkins 作业日志中收到以下异常。 Does anyone has any idea why this is happening?有谁知道为什么会这样? I am trying to deploy to tomcat 8. I configured deployer plugin using the following:我正在尝试部署到 tomcat 8。我使用以下配置部署器插件:

manager username and password管理员用户名和密码
Tomcat URL: http://hostname:9080/ Tomcat 网址: http://hostname:9080/

ERROR: Publisher hudson.plugins.deploy.DeployPublisher aborted due to exception
java.io.IOException: Expecting Ant GLOB pattern, but saw '/var/lib/jenkins/.m2/repository/com/wcm/wcm-admin/1.0/wcm-admin-1.0.war'. See http://ant.apache.org/manual/Types/fileset.html for syntax
    at hudson.FilePath.glob(FilePath.java:1734)
    at hudson.FilePath.access$1700(FilePath.java:191)
    at hudson.FilePath$32.invoke(FilePath.java:1715)
    at hudson.FilePath$32.invoke(FilePath.java:1712)
    at hudson.FilePath.act(FilePath.java:989)
    at hudson.FilePath.act(FilePath.java:967)
    at hudson.FilePath.list(FilePath.java:1712)
    at hudson.FilePath.list(FilePath.java:1697)
    at hudson.FilePath.list(FilePath.java:1683)
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:59)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1037)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
    at hudson.model.Run.execute(Run.java:1743)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)
Finished: FAILURE

I user the full path of war file as the value of "WAR/EAR files".我使用war文件的完整路径作为“WAR/EAR files”的值。 When I set the value as "**/*.war" it worked.当我将值设置为“**/*.war”时,它起作用了。

“WAR/EAR files”的值必须是工作空间的相对路径

In order for Tomcat to accept remote deployments, you have to add a user with the role manager-script.为了让 Tomcat 接受远程部署,您必须添加一个具有角色管理器脚本的用户。 To do so edit the file ../conf/tomcat-users.xml and add the following line:为此,请编辑文件 ../conf/tomcat-users.xml 并添加以下行:

..and then add the same user name in Jenkins. ..然后在Jenkins中添加相同的用户名。

The problem you are facing because the path takes GLOBAL pattern您面临的问题是因为路径采用 GLOBAL 模式看图**/*.war **/*。战争

This should work.这应该有效。

It was expecting the file to be defined like /*.yaml它期望文件被定义为/*.yaml

Don't think to define the whole path for the file in case you encounter this.如果遇到这种情况,请不要考虑定义文件的整个路径。 Just define like above highlighted.只需像上面突出显示的那样定义。 This will read from the directory where you have the YAML file.这将从您拥有 YAML 文件的目录中读取。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM