Skip to content

Long execution times with jgit #408

@jiri-pejchal

Description

@jiri-pejchal

The revision goal takes 38 s in our project when using jgit. Because builds are tagged we have about 5000 tags in git repository so that may be the cause.

When the git binary is used:
<useNativeGit>true</useNativeGit>
instead of jgit the goal execution is down to 3.6 s.

 <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <version>2.2.6</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <dotGitDirectory>${project.basedir}/.git</dotGitDirectory>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <failOnNoGitDirectory>false</failOnNoGitDirectory>
                    <generateGitPropertiesFile>false</generateGitPropertiesFile>
                    <dateFormat>yyyy-MM-dd HH:mm</dateFormat>
                    <gitDescribe>
                        <!-- don't generate the describe property -->
                        <skip>false</skip>
                        <!-- when the build is triggered while the repo is in "dirty state", append this suffix -->
                        <dirty>-DEV</dirty>
                        <tags>true</tags>
                        <!--
                             always print using the "tag-commits_from_tag-g_commit_id-maybe_dirty" format, even if "on" a tag.
                             The distance will always be 0 if you're "on" the tag.
                        -->
                        <forceLongFormat>false</forceLongFormat>
                    </gitDescribe>
                    <excludeProperties>
                        <excludeProperty>git.build.user.*</excludeProperty>
                        <excludeProperty>git.commit.message.*</excludeProperty>
                        <excludeProperty>git.commit.user</excludeProperty>
                        <excludeProperty>git.remote.origin.*</excludeProperty>
                    </excludeProperties>
                    <runOnlyOnce>true</runOnlyOnce>
                    <injectAllReactorProjects>true</injectAllReactorProjects>
                    <skipPoms>false</skipPoms>
                </configuration>

            </plugin>
$ java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
$ mvn --version
Apache Maven 3.6.0 (97c98ec64a1fdfee7767ce5ffb20918da4f719f3; 2018-10-24T20:41:47+02:00)
Maven home: C:\software\apache-maven\bin\..
Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_181\jre
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions