由于将异常复制到容器而导致步骤“将战争/耳朵部署到容器”中止

时间:2019-12-06 06:59:20

标签: maven jenkins

将战争复制到tomcat服务器时出现错误

[INFO] Replacing /var/lib/jenkins/workspace/war-deploy-tomcat/target/TC-maven-0.1.0.jar with /var/lib/jenkins/workspace/war-deploy-tomcat/target/TC-maven-0.1.0-shaded.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.722 s
[INFO] Finished at: 2019-12-06T06:32:19Z
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /var/lib/jenkins/workspace/war-deploy-tomcat/pom.xml to www.techiescorner.in/TC-maven/0.1.0/TC-maven-0.1.0.pom
[JENKINS] Archiving /var/lib/jenkins/workspace/war-deploy-tomcat/target/TC-maven-0.1.0.jar to www.techiescorner.in/TC-maven/0.1.0/TC-maven-0.1.0.jar
channel stopped
ERROR: Step ‘Deploy war/ear to a container’ aborted due to exception: 
java.lang.InterruptedException: [DeployPublisher][WARN] No wars found. Deploy aborted. %n
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:107)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
    at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1074)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
    at hudson.model.Run.execute(Run.java:1840)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE
  1. 我已确认可以从我的詹金斯连接到tomcat服务器
        服务器在端口8080上。

    1. 已确认tomcat用户具有正确的权限()

    2. 项目配置详细信息。 enter image description here enter image description here

    3. 代码在github https://github.com/techiescorner/sample-maven-project.git

    4. 我可以看到tar文件是在Jenkins工作区目标文件夹下生成的。
    5. 已确认已安装github和maven插件。

3 个答案:

答案 0 :(得分:1)

检查pom文件..如果使用

finalName>名称

仅在此标记名称中创建的战争文件。您仅需使用该名称(* .war)

答案 1 :(得分:0)

检查您在/usr/share/tomcat/conf/tomcat-users.xml中创建的用户 如果您输入正确的用户名和密码 并且,如果您找到了->,则表示您已发表评论,并且您仍然无法正常工作。

答案 2 :(得分:0)

您的输出文件为.jar格式。为了将其部署到Web应用程序,您需要将其构建为.war文件。您可以将pom.xml文件更改为.war。它应该看起来像这样。

<groupId>com.sarav</groupId>
<artifactId>TomcatMavenApp</artifactId>
<version>2.0</version>
<packaging>war</packaging>