I currently use the exec-maven-plugin
to run a java class that aims to generate a text file as output.
I commit then the resulted file to the git repository using the maven-scm-plugin
.
The issue here is that sometimes the generated file is similar to the already commited one and this triggers a maven error when I try to commit the file (as expected).
I would like then to avoid commiting the file using maven-scm-plugin
but cannot figure out how I can know whether it has changed or not.
I found that the scm-plugin's diff
and status
goals allow to get this information, but I am unable to store the result of the goals somewhere in order to parse it then set some boolean value that I can use to run or skip the commit.
May I have some help ?
Thanks !