diff --git a/vars/mavenBuild.groovy b/vars/mavenBuild.groovy new file mode 100644 index 0000000..6d08d8a --- /dev/null +++ b/vars/mavenBuild.groovy @@ -0,0 +1,11 @@ +#!/usr/bin/env groovy +// Build a Maven project inside the maven container of the pod. +// Usage: mavenBuild() or mavenBuild(goals: 'clean test') +def call(Map config = [:]) { + def goals = config.goals ?: 'clean package' + container('maven') { + stage('Maven build') { + sh "mvn ${goals}" + } + } +}