diff --git a/src/com/sap/piper/Utils.groovy b/src/com/sap/piper/Utils.groovy index f24873d8c..1234bf665 100644 --- a/src/com/sap/piper/Utils.groovy +++ b/src/com/sap/piper/Utils.groovy @@ -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 }