0

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 !

Anas
  • 437
  • 6
  • 19
  • Something which is generated shouldn't be checked in..Only the source out of which is has been generated.. – khmarbaise Aug 30 '18 at 17:38
  • @khmarbaise Thanks for you reply. I agree that in general, as long as we can generate something from a source, it is the source that should be checked in. But It turns out in my case that the generated file describes an application's metadata that may change between two consecutive versions. I need then to check it in everytime I create a git tag. Can you please advise a workaround to achieve this ? Thanks. – Anas Aug 30 '18 at 19:33
  • If you generate it somehow write a maven plugin which handles this correctly and you have solve everything...and never checkin generated code.... – khmarbaise Sep 01 '18 at 10:50
  • Did you find a solution to your issue? – Hunsu Mar 01 '21 at 11:18

0 Answers0