[
https://issues.apache.org/jira/browse/MNG-6858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17029357#comment-17029357
]
Chris Hennick commented on MNG-6858:
------------------------------------
[~khmarbaise] Is there, by any chance, a way to automatically audit all my
Maven invocations for similarly redundant steps? (Note that running the same
unit tests in Surefire and Failsafe is not redundant, because it lets me
collect a coverage report _and_ detect breakages caused by the Proguard config.
Proguard is the pre-integration-test step, but I'm not sure that's the optimal
place for it; my project's lifecycle doesn't seem to match any documented
examples.)
> 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
> Priority: Major
>
> I have a bash script that sets a sometimes-empty variable as follows:
>
> {code:java}
> if [ "${ANDROID}" = "true" ]; then
> MAYBE_ANDROID_FLAG=-Pandroid
> else
> MAYBE_ANDROID_FLAG=
> fi{code}
>
> It's used like so:
>
> {code:java}
> mvn ${MAYBE_ANDROID_FLAG} clean compile jacoco:instrument
> jacoco:prepare-agent test jacoco:restore-instrumented-classes jacoco:report
> -e -B}}{code}
>
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)