New clean up stage.
This commit is contained in:
parent
3fc96549bd
commit
5ad17a0592
|
@ -3,30 +3,33 @@
|
||||||
def (options,maven_local_repo_path,maven_settings_file) = ['','','']
|
def (options,maven_local_repo_path,maven_settings_file) = ['','','']
|
||||||
|
|
||||||
if (params.Type == 'SNAPSHOT-DRY-RUN') {
|
if (params.Type == 'SNAPSHOT-DRY-RUN') {
|
||||||
echo "Will configure Maven for SNAPSHOT-DRY-RUN artifacts"
|
echo "Configure Maven for SNAPSHOT-DRY-RUN artifacts"
|
||||||
options = ''
|
options = ''
|
||||||
maven_local_repo_path = '~/local-snapshots'
|
maven_local_repo_path = '~/local-snapshots'
|
||||||
maven_settings_file = '~/.m2/jenkins-shapshots-dry-run-settings.xml'
|
maven_settings_file = '~/.m2/jenkins-shapshots-dry-run-settings.xml'
|
||||||
}
|
}
|
||||||
if (params.Type == 'SNAPSHOT') {
|
if (params.Type == 'SNAPSHOT') {
|
||||||
echo "Will configure Maven for SNAPSHOT artifacts"
|
echo "Configure Maven for SNAPSHOT artifacts"
|
||||||
options = ''
|
options = ''
|
||||||
maven_local_repo_path = '~/local-snapshots'
|
maven_local_repo_path = '~/local-snapshots'
|
||||||
// use the default settings
|
// use the default settings
|
||||||
maven_settings_file = '~/.m2/settings.xml'
|
maven_settings_file = '~/.m2/settings.xml'
|
||||||
}
|
}
|
||||||
if (params.Type == 'RELEASE-DRY-RUN') {
|
if (params.Type == 'RELEASE-DRY-RUN') {
|
||||||
echo "Will configure Maven for RELEASE-DRY-RUN artifacts"
|
echo "Configure Maven for RELEASE-DRY-RUN artifacts"
|
||||||
options = ''
|
options = ''
|
||||||
maven_local_repo_path = '~/local-releases'
|
maven_local_repo_path = '~/local-releases'
|
||||||
maven_settings_file = '~/.m2/jenkins-releases-dry-run-settings.xml'
|
maven_settings_file = '~/.m2/jenkins-releases-dry-run-settings.xml'
|
||||||
}
|
}
|
||||||
if (params.Type == 'RELEASE') {
|
if (params.Type == 'RELEASE') {
|
||||||
echo "Will configure Maven for RELEASE artifacts"
|
echo "Configure Maven for RELEASE artifacts"
|
||||||
options = ''
|
options = ''
|
||||||
maven_local_repo_path = '~/local-releases'
|
maven_local_repo_path = '~/local-releases'
|
||||||
maven_settings_file = '~/.m2/jenkins-releases-settings.xml'
|
maven_settings_file = '~/.m2/jenkins-releases-settings.xml'
|
||||||
}
|
}
|
||||||
|
echo "Use settings file at ${maven_settings_file}"
|
||||||
|
echo "Use local repo at ${maven_local_repo_path}"
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
|
@ -42,6 +45,14 @@ pipeline {
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
stage('clean up before starting') {
|
||||||
|
script {
|
||||||
|
echo "Create a fresh local repository"
|
||||||
|
rm -rf "${maven_local_repo_path}"
|
||||||
|
mkdir -p "${maven_local_repo_path}"
|
||||||
|
echo "Done with local repository"
|
||||||
|
}
|
||||||
|
}
|
||||||
stage('build core components') {
|
stage('build core components') {
|
||||||
steps {
|
steps {
|
||||||
withMaven(jdk: 'OpenJDK 8', mavenLocalRepo: "${maven_local_repo_path}", mavenSettingsFilePath: "${maven_settings_file}") {
|
withMaven(jdk: 'OpenJDK 8', mavenLocalRepo: "${maven_local_repo_path}", mavenSettingsFilePath: "${maven_settings_file}") {
|
||||||
|
|
Loading…
Reference in New Issue