pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                echo 'Building...'
                sh 'mvn clean & mvn validate & mvn compile'
            }
        }
        stage('Test') {
            steps {
                echo 'Testing...'
                sh 'mvn clean & mvn test'
            }
        }
        stage('Deploy') {
             steps {
                echo 'Deploying...'
                sh 'mvn clean & mvn compile & mvn package & mvn verify & mvn install'
                archiveArtifacts artifacts: '**/target/*.jar', fingerprint: true
            }
        }
    }
}