Home > Software design >  Jenkins pipeline mvn Package command not working
Jenkins pipeline mvn Package command not working

Time:10-20

My test is working fine as Maven project. It fetches code from Git.

I wanted to execute the same in Pipeline so I wrote the below script for pipeline project.


pipeline {
    agent any

    stages {
        stage('Getting the project from GIT') {
            steps {
               echo 'Pulling..';
                git branch: 'main',
                url: 'https://github.com/user/project.git';
            }
        }
        
    stage('Cleaning the project') {
             
            steps {
                echo 'cleaning project ...'
                sh 'mvn clean'
            }
        }
        
    stage('Artifact Construction') {
             
            steps {
                echo "artificat contruction"
                sh 'mvn package'
            }
        }

    }
}

But when I execute , the third stage seems not to work.

enter image description here

Console output: enter image description here

enter image description here

Maven configuration :

enter image description here

This is the version of Maven

enter image description here

I tried everything to solve this issue, can you guys help me? Is it a maven version problem?

CodePudding user response:

You are running maven version - 3.0.5. Maven resource plugin -3.2.0 is not compatible with this version of maven.

Upgrade maven installation to higher version. You can refer below plugin documentation page: https://maven.apache.org/plugins-archives/maven-resources-plugin-3.2.0/plugin-info.html

  • Related