I want to grep the result of a maven (maven-help plugin) command and store the grep result in a shell variable and use it in .gitlab-ci.yml file.
I've tried this and the maven command prints the desired result, but echo $VERSION prints nothing (i.e. VERSION variable is empty):
VERSION= mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version
I've also tried this and it gets error: Downloading:: command not found:
VERSION= $(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate "-Dexpression=project.version" | grep -v '\[')
So how can i store the grep result in a variable?