mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
Utils.evaluateFromMavenPom(): Handle errors (#1192)
Handle error to evaluate by throwing an exception
This commit is contained in:
parent
4835fbffab
commit
2014a8b4ae
@ -163,5 +163,13 @@ static String evaluateFromMavenPom(Script script, String pomFileName, String pom
|
||||
defines: "-Dexpression=$pomPathExpression -DforceStdout -q",
|
||||
returnStdout: true
|
||||
)
|
||||
if (resolvedExpression.startsWith('null object or invalid expression')) {
|
||||
// There is no error indication (exit code or otherwise) from the
|
||||
// 'evaluate' Maven plugin, only this output to stdout. The calling
|
||||
// code assumes an empty string is returned when the property could
|
||||
// not be resolved.
|
||||
throw new RuntimeException("Cannot evaluate property value from '${pomFileName}', " +
|
||||
"missing property or invalid expression '${pomPathExpression}'.")
|
||||
}
|
||||
return resolvedExpression
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user