You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me try to understand this correctly:
When trying to get the app.docker.version it returns null and not any variable (e.g. the outcome of ${version}-${git.commit.id.abbrev})?
If this is the case then that sounds like an issue with the org.codehaus.mojo:exec-maven-plugin and not this plugin. In general my suspect is that sounds related to running maven with a it's Plugin's Prefix (e.g. instead of mvn clean package you run with mvn clean org.codehaus.mojo:exec-maven-plugin:1.3.1:exec...). Within maven that might yield to surprises and the plugin properly needs to obtain the properties (e.g. checking System.getProperty). I can't recall the details what this plugin did, but as reference I'd point to
Just tested this locally and indeed this is a classical 'plugin' prefix problem.
Try running without the -q option to see what tasks are executed.
When running with mvn -Dexec.executable="echo" -Dexec.args='${app.docker.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec only the exec-task is being executed:
[INFO] Scanning for projects...
[INFO]
[INFO] ---------< pl.project13.maven:git-commit-id-plugin-debugging >----------
[INFO] Building Git Commit Id Plugin Maven Mojo Debugging 0.0.3-SNAPSHOT
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.3.1:exec (default-cli) @ git-commit-id-plugin-debugging ---
0.0.3-SNAPSHOT-null
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.824 s
[INFO] Finished at: 2020-07-14T22:15:43+02:00
[INFO] ------------------------------------------------------------------------
Where should the ${git.commit.id.abbrev} come from when the plugin is not even run?
You also need to add this plugin to the execution graph:
We have our tagged docker images being pushed to Docker hub with the following custom property
app.docker.version
.We wanted to grab this property from the command line and pass it to our deploy step on the CI/CD server.
Running
mvn -f api-server/pom.xml -q -Dexec.executable="echo" -Dexec.args='${app.docker.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec
from the command line however returnsnull
.We can get the
project.version
just fine but notapp.docker.version
. Any ideas? (thanks)The text was updated successfully, but these errors were encountered: