Reputation: 1013
I have a jenkins pipeline job, that is depending on simple Jenkinsfile instructions:
pipeline {
agent any
stages {
stage('Install Dep') {
steps {
sh 'ls'
configFileProvider([configFile(fileId: '3fada107-8341-40ec-b1b6-d49e48479157', variable: 'SETTINGS')]) {
sh 'ls'
sh 'mvn -gs SETTINGS install'
}
}
}
}
}
When i'm trying to build, i got the following Error:
+ mvn -gs SETTINGS install
[ERROR] Error executing Maven.
[ERROR] The specified global settings file does not exist: /home/jenkins/workspace/FBPMCB2/SETTINGS
I'm using Config File Management plugin to define the settings.xml file, and it's defined but i'm not sure why i'm still getting this error, advise please?
Upvotes: 1
Views: 4950
Reputation: 4767
I think you have the two options confused. From: Maven CLI Options Reference.
-gs,--global-settings <arg>
Alternate path for the global settings file
-s,--settings <arg>
Alternate path for the user settings file
From Using the configuration files in Jenkins Pipelines, it should be:
sh 'mvn -s SETTINGS install'
withMaven(globalMavenSettingsConfig: 'globalSettings', mavenSettingsConfig: 'settings')
sh "mvn install"
}
where globalSettings
and settings
are the names of your respective global and settings overrides (you can override the file-id with a readable name in the config file provider plugin)
Upvotes: 2