Richie Richie - 22 days ago 6
Git Question

@version %I%, %G% and git

I have read that you can use the following in your javadoc and your source control is meant to replace the variables with version information...

@version %I%, %G%


I tried it out using my Maven project but the magic is not happening.

How can I make this work with Git and my springboot maven project?

thanks

Answer

I think that the problem is that you are using the wrong names and/or markers for the attributes. According to this:

https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes

the marker character is $ not % ... and the variable names don't look right to me.

But the same page says that doing substitution like this is rather tricky. You need to read the entire section about "Keyword Expansion". (And as a result of that, you may want to abandon the whole idea!!)