i have created a pipeline job in Jenkins where i use the following Jenkinsfile:
def remote=[:]
remote.name = 'ec2-user'
remote.host = '3.85.186.135'
remote.allowAnyHosts = true
pipeline {
agent any
environment{
PI_CREDS=credentials('ec2-user')
}
tools
{
maven "maven-3.9.6"
}
stages {
stage('checkout') {
steps {
git branch: 'master', url: 'https://github.com/mariancap/world.git'
}
}
stage('Execute Maven') {
steps {
sh 'mvn clean install'
}
}
}
post{
always{
sleep 5
}
}
}
When i run the job it start to freeze and the entire page stops working. Here is where the job blocks:
+ mvn clean install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.example.maven-project:server:jar:1.0-SNAPSHOT
[WARNING] Reporting configuration should be done in <reporting> section, not in maven-site-plugin <configuration> as reportPlugins parameter.
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.example.maven-project:webapp:war:1.0-SNAPSHOT
[WARNING] Reporting configuration should be done in <reporting> section, not in maven-site-plugin <configuration> as reportPlugins parameter.
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.example.maven-project:maven-project:pom:1.0-SNAPSHOT
[WARNING] Reporting configuration should be done in <reporting> section, not in maven-site-plugin <configuration> as reportPlugins parameter. @ line 58, column 24
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[WARNING] The project com.example.maven-project:maven-project:pom:1.0-SNAPSHOT uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Maven Project [pom]
[INFO] Server [jar]
[INFO] Webapp [war]
[INFO]
[INFO] --------------< com.example.maven-project:maven-project >---------------
[INFO] Building Maven Project 1.0-SNAPSHOT [1/3]
[INFO] from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ maven-project ---
[INFO]
[INFO] --- install:3.1.1:install (default-install) @ maven-project ---
[INFO] Installing /var/lib/jenkins/workspace/test/pom.xml to /var/lib/jenkins/.m2/repository/com/example/maven-project/maven-project/1.0-SNAPSHOT/maven-project-1.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------< com.example.maven-project:server >------------------
[INFO] Building Server 1.0-SNAPSHOT [2/3]
[INFO] from server/pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ server ---
[INFO] Deleting /var/lib/jenkins/workspace/test/server/target
[INFO]
[INFO] --- resources:2.5:resources (default-resources) @ server ---
[debug] execute contextualize
[INFO] Using 'utf-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/test/server/src/main/resources
[INFO]
[INFO] --- compiler:2.3.2:compile (default-compile) @ server ---
[INFO] Compiling 1 source file to /var/lib/jenkins/workspace/test/server/target/classes
[INFO]
[INFO] --- resources:2.5:testResources (default-testResources) @ server ---
[debug] execute contextualize
[INFO] Using 'utf-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/test/server/src/test/resources
[INFO]
[INFO] --- compiler:2.3.2:testCompile (default-testCompile) @ server ---
[INFO] Compiling 1 source file to /var/lib/jenkins/workspace/test/server/target/test-classes
[INFO]
[INFO] --- surefire:2.11:test (default-test) @ server ---
[INFO] Surefire report directory: /var/lib/jenkins/workspace/test/server/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.example.TestGreeter
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.099 sec
Results :
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- jar:3.3.0:jar (default-jar) @ server ---
[INFO] Building jar: /var/lib/jenkins/workspace/test/server/target/server.jar
[INFO]
[INFO] --- install:3.1.1:install (default-install) @ server ---
[INFO] Installing /var/lib/jenkins/workspace/test/server/pom.xml to /var/lib/jenkins/.m2/repository/com/example/maven-project/server/1.0-SNAPSHOT/server-1.0-SNAPSHOT.pom
[INFO] Installing /var/lib/jenkins/workspace/test/server/target/server.jar to /var/lib/jenkins/.m2/repository/com/example/maven-project/server/1.0-SNAPSHOT/server-1.0-SNAPSHOT.jar
[INFO]
[INFO] ------------------< com.example.maven-project:webapp >------------------
[INFO] Building Webapp 1.0-SNAPSHOT [3/3]
[INFO] from webapp/pom.xml
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ webapp ---
[INFO] Deleting /var/lib/jenkins/workspace/test/webapp/target
[INFO]
[INFO] --- resources:2.5:resources (default-resources) @ webapp ---
[debug] execute contextualize
[INFO] Using 'utf-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/test/webapp/src/main/resources
[INFO]
[INFO] --- compiler:2.3.2:compile (default-compile) @ webapp ---
[INFO] No sources to compile
[INFO]
[INFO] --- resources:2.5:testResources (default-testResources) @ webapp ---
[debug] execute contextualize
[INFO] Using 'utf-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/test/webapp/src/test/resources
[INFO]
[INFO] --- compiler:2.3.2:testCompile (default-testCompile) @ webapp ---
[INFO] No sources to compile
[INFO]
[INFO] --- surefire:2.11:test (default-test) @ webapp ---
[INFO] No tests to run.
[INFO] Surefire report directory: /var/lib/jenkins/workspace/test/webapp/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Can the problem be related to the node ?
I had this problem with the node from the beggining of using Jenkins, but i had no problems with another jobs
And i will show you also the pom.xml file
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.example.maven-project</groupId>
<artifactId>maven-project</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>webapp</artifactId>
<packaging>war</packaging>
<name>Webapp</name>
<description>Webapp.</description>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
It has been not updated from 6 years ago, i just forked the code from another git hub account