Ok, so this is my solution, it is surely not the most efficient way to do it, but it does the trick :
In my pom.xml, i have added this :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>generate-resources</phase>
<configuration>
<target>
<macrodef name="gitlog">
<attribute name="lfile" />
<sequential>
<local name="gitHash"/>
<exec executable="git" outputproperty="gitHash">
<arg value="log" />
<arg value="--format=%H" />
<arg value="-n" />
<arg value="1" />
<arg value="--" />
<arg value="@{lfile}" />
</exec>
<concat append="true" destfile="target/classes/api_hashes.txt">@{lfile}:${gitHash}${line.separator}</concat>
</sequential>
</macrodef>
<loadfile property="api.classes" srcFile="api_classes.txt" />
<delete file="target/classes/api_hashes.txt"/>
<ac:for list="${api.classes}" param="classFile" delimiter="|" xmlns:ac="antlib:net.sf.antcontrib">
<sequential>
<gitlog lfile="@{classFile}" />
</sequential>
</ac:for>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>1.0b3</version>
<exclusions>
<exclusion>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</plugin>
My api_classes.txt file contain a list of classes file (source) separated by the char | (was unable to use cariage returns) in one line, and it generate a file containing a liste of source, the char : and the last git hash for earch source.