Newer
Older
mocking / Jenkinsfile
pipeline {

    agent {
       docker {
           image 'maven:3.5.0-jdk-8'
	   args '-v $HOME/.m2:/root/.m2'
       }
    }

    stages {

        stage ('準備') {
            steps {
                checkout scm
            }
        }

        stage ('ビルド') {
            steps {
                withEnv(['MAVEN_OPTS=-Xmx512m']) {
                    sh "mvn -Dmaven.test.failure.ignore clean install"
                }
            }
        }

        stage ('解析') {
            steps {
                junit '**/target/surefire-reports/TEST-*.xml'
            }
        }

    }

    post {
        success {
            archiveArtifacts artifacts: "**/target/*.jar, **/target/*.zip"
        }
    }
}