将战争复制到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
我已确认可以从我的詹金斯连接到tomcat服务器
服务器在端口8080上。
已确认tomcat用户具有正确的权限()
代码在github https://github.com/techiescorner/sample-maven-project.git
答案 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>