jenkins 步骤“将war/ear部署到容器”由于无法复制到容器而中止

flseospp  于 2023-03-17  发布在  Jenkins
关注(0)|答案(5)|浏览(175)

将war复制到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.我已经确认我可以从我的jenkins连接到tomcat服务器
服务器端口8080。
1.已确认tomcat用户具有正确的权限()
1.项目配置详细信息。

1.代码位于github https://github.com/techiescorner/sample-maven-project.git
1.我可以看到在Jenkins工作区目标文件夹下生成了tar文件。
1.已确认安装了github和maven插件。

sirbozc5

sirbozc51#

检查pom文件..如果你使用
最终名称〉名称〈/最终名称标签**--
war文件只在此标记名中创建..您只需要使用该名称(*.war)

bis0qfac

bis0qfac2#

您可能缺少此配置**/*.war的格式:
1.不要在*.war之间使用空格
1.

uklbhaso

uklbhaso3#

检查您在/usr/share/tomcat/conf/tomcat-users. xml中创建的用户名和密码是否正确,如果输入了但仍然无法工作,请检查您的和是否不是注解,如果您找到--〉,则表示它是注解,您的tomcat无法检测到该用户

v64noz0r

v64noz0r4#

您的输出文件是.jar格式。为了将其部署到Web应用程序,您需要将其构建为.war文件。您可以将pom.xml文件更改为构建为. war文件。它应如下所示。

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

fslejnso5#

我也遇到了同样的问题。我发现,projecttag的子项,我需要添加packagingtag和value war。您可以在versiontag下面添加。

<packaging>war</packaging>

相关问题