Quarkus JGit

The Quarkus JGit extension enables the use of Eclipse JGit in a native executable.


Once you have your Quarkus project configured you can add the jgit extension to your project by running the following command in your project base directory:

./mvnw quarkus:add-extension -Dextensions="jgit"

This will add the following to your pom.xml:



The JGit dependency is resolved transitively when the extension is added to your project. Here is an example using it in a JAX-RS endpoint:

    public String cloneRepository(@QueryParam("url") String url) throws Exception {
        File tmpDir = Files.createTempDirectory("tmpgit").toFile();
        try (Git git = Git.cloneRepository().setDirectory(tmpDir).setURI(url).call()) {
            return tmpDir.toString();

When building a native executable, make sure that the SSL support is configured appropriately.