Oh, another thing I just noticed. Generally people like to think "eval is evil", and while imo eval has it's place, especially in BASH, you can avoid using eval with various tricks.
if [[ "$NEED_EXTRA" == "1" ]]; then
"$JAVA" "$APP" $EXTRA
It's got a lot to do with how variable expansion and quoting works.
So in your specific example
COMMAND="mvn clean install -P$PROFILE -Dcrx.user=$USER -Dcrx.password=$PASSWORD"
I would instead write that as
mvn clean install "-P$PROFILE" "-Dcrx.user=$USER" "-Dcrx.password=$PASSWORD"
I agree with you that eval, in most languages is viewed as evil. But that's largely because it might be used in applications with a lot of end users, where it is possible for something malicious to happen.
In this case, and for bash, the scripts are for productivity where you (the developer) or your immediate team are the one's running them and they are not meant for production applications.
Overall, I think it is worth pointing that out in the post :)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.