Chris Hennick created MNG-6858: ---------------------------------- Summary: Need a way to skip empty-string arguments Key: MNG-6858 URL: https://issues.apache.org/jira/browse/MNG-6858 Project: Maven Issue Type: Improvement Components: Command Line Affects Versions: 3.6.1 Environment: Ubuntu 19.10 Reporter: Chris Hennick
I have a bash script that sets a sometimes-empty variable as follows: {{if [ "${ANDROID}" = "true" ]; then}} {{ MAYBE_ANDROID_FLAG=-Pandroid}} {{else}} {{ MAYBE_ANDROID_FLAG=}} {{fi}} {{It's used like so:}} {{mvn ${MAYBE_ANDROID_FLAG} clean compile jacoco:instrument jacoco:prepare-agent \}} {{ test jacoco:restore-instrumented-classes jacoco:report -e -B}} {code:java} Shell-scripting best practices dictate that ${MAYBE_ANDROID_FLAG} above should be in double quotes, but when I do that, I get 'Unknown lifecycle phase ""'. For it to be possible to follow best practices, then, we need a way to make Maven skip over command-line arguments that are empty strings. {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)