---
url: /howto/setting-up-profiler-tga/java/git-properties.md
---

To upload the coverage to the correct commit in Teamscale, add a `git.properties` file to your jar/war. Depending on your environment there are multiple options:
::: tabs
\== Maven
Just add the following plugin to your build:

```xml
<build>
    <plugins>
		<plugin>
			<groupId>io.github.git-commit-id</groupId>
			<artifactId>git-commit-id-maven-plugin</artifactId>
			<version>9.0.1</version>
			<executions>
				<execution>
					<id>get-the-git-infos</id>
					<goals>
						<goal>revision</goal>
					</goals>
					<phase>initialize</phase>
				</execution>
			</executions>
			<configuration>
				<generateGitPropertiesFile>true</generateGitPropertiesFile>
			</configuration>
		</plugin>
    </plugins>
</build>
```

\== Gradle
You can achieve this by applying the [gradle-git-properties plugin](https://plugins.gradle.org/plugin/com.gorylenko.gradle-git-properties), as shown in the following example:

```groovy
plugins {
    id "com.gorylenko.gradle-git-properties" version "2.4.2"
}
```

\== Other
In case you are not using Git with Maven or Gradle you can also generate the `git.properties` file in your build.
This file needs to contain a `git.commit.id` property corresponding to the respective code revision the current application was built from:

```properties
git.commit.id=6f735064d5a125d35a546675ee61a5f4a0f840aa
# When you intend to upload to Artifactory also add the following
git.branch=master
git.commit.time=1593781474000
```

The file needs to be packaged into the jar or war file of your application.
:::
