Coder Social home page Coder Social logo

qoomon / gradle-git-versioning-plugin Goto Github PK

View Code? Open in Web Editor NEW
93.0 3.0 12.0 676 KB

This extension will set project version, based on current Git branch or tag.

License: GNU General Public License v3.0

Java 100.00%
git versioning tag branch repository generated gradle-plugin gradle maven maven-plugin maven-extension git-describe

gradle-git-versioning-plugin's Introduction

Gradle Git Versioning Plugin Sparkline

Gradle Plugin Portal Changelog Build Workflow LGTM Grade

ℹ Also available as Maven Extension

Example

This plugin can virtually set project version and properties, based on current Git status.

No files will be modified, version and properties are modified in memory only.

  • Get rid of...
    • editing build.gradle
    • managing project versions within files and Git tags
    • git merge conflicts

Usage

Add Plugin to Gradle Project

⚠️ Minimum required Java version 11

⚠️ You should apply git versioning (gitVersioning.apply{...}) directly after version declaration at root project only.

Groovy DSL build.gradle

plugins {
    id 'me.qoomon.git-versioning' version '6.4.2'
}

version = '0.0.0-SNAPSHOT'
gitVersioning.apply {
    // see configuration documentation below
}

Kotlin DSL build.gradle.kts

plugins {
    id("me.qoomon.git-versioning") version "6.4.2"
}

version = "0.0.0-SNAPSHOT"
gitVersioning.apply {
    // see configuration documentation below
}

Configure Plugin

ℹ Consider CI/CD section when running this plugin in a CI/CD environment

You can configure the version and properties adjustments for specific branches and tags.

Groovy DSL Example: build.gradle

version = '0.0.0-SNAPSHOT'
gitVersioning.apply {
    refs {
        branch('.+') {
            version = '${ref}-SNAPSHOT'
        }
        tag('v(?<version>.*)') {
            version = '${ref.version}'
        }
    }

    // optional fallback configuration in case of no matching ref configuration
    rev {
        version = '${commit}'
    }
}

Kotlin DSL Example: build.gradle.kts

version = "0.0.0-SNAPSHOT"
gitVersioning.apply {
    refs {
        branch(".+") {
            version = "\${ref}-SNAPSHOT"
        }
        tag("v(?<version>.*)") {
            version = "\${ref.version}"
        }
    }

    // optional fallback configuration in case of no matching ref configuration
    rev {
        version = "\${commit}"
    }
}

Configuration Options

  • disable global disable(true)/enable(false) extension, default is false.

    • Can be overridden by command option, see (Parameters & Environment Variables)[#parameters-&-environment-variables]
  • describeTagPattern An arbitrary regex to match tag names for git describe command

    • has to be a full match pattern e.g. v(.+), default is .*
  • describeTagFirstParent Enable(true) or disable(false) following only the first parent in a merge commit

    • default is true
  • updateGradleProperties Enable(true)/disable(false) version and properties update in gradle.properties file, default is false

    • Can be overridden by command option, see (Parameters & Environment Variables)[#parameters-&-environment-variables]
  • refs List of ref configurations, ordered by priority.

    • ℹ First matching configuration will be used.

    • considerTagsOnBranches By default, tags pointing at current commit will be ignored if HEAD is attached to a branch.

      • If this option is true tags will always be taken into account.

    • branch(pattern)/tag(pattern) specific ref patch definition.

      • pattern An arbitrary regex to match ref names

        • has to be a full match pattern e.g. main or feature/.+

      • describeTagPattern An arbitrary regex to match tag names for git describe command

        • has to be a full match pattern e.g. v.+)
        • will override global describeTagPattern value
      • describeTagFirstParent Enable(true) or disable(false) following only the first parent in a merge commit

        • default is true

      • version The new version format, see Format Placeholders

      • properties A property definitions to update the value of a property.

        • name The property name
        • value The new value format of the property, see Format Placeholders

          groovy
          properties = [
            "name" : "value",
          ]
          ⚠️ groovy.lang.MetaClass hides properties config field.
          If you need to call a method on properties config field, you need to use the alias field properties_ e.g. properties_.put("name", "value")

          kotlin
          properties = mapOf(
            "name" to "value",
          )            

      • updateGradleProperties Enable(true) or disable(false) version and properties update in gradle.properties file

        • will override global updateGradleProperties value
  • rev Rev configuration will be used if no ref configuration is matching current git situation.

    • same as branch(pattern)/tag(pattern) configuration, except pattern parameter.

Format Placeholders

….slug placeholders means all / characters will be replaced by -.

ℹ Final version will be slugified automatically, so no need to use ${….slug} placeholders in version format.

ℹ define placeholder default value (placeholder is not defined) like this ${name:-DEFAULT_VALUE}
e.g ${env.BUILD_NUMBER:-0} or ${env.BUILD_NUMBER:-local}

ℹ define placeholder overwrite value (placeholder is defined) like this ${name:+OVERWRITE_VALUE}
e.g ${dirty:-SNAPSHOT} resolves to -SNAPSHOT instead of -DIRTY

Placeholders
  • ${env.VARIABLE} Value of environment variable VARIABLE

  • ${property.name} Value of commandline property -Pname=value

  • ${version} version set in build.gradle e.g. '1.0.0-SNAPSHOT'

    • ${version.core} the core version component of ${version} e.g. '1.2.3'
    • ${version.major} the major version component of ${version} e.g. '1'
      • ${version.major.next} the ${version.major} increased by 1 e.g. '2'
    • ${version.minor} the minor version component of ${version} e.g. '2'
      • ${version.minor.next} the ${version.minor} increased by 1 e.g. '3'
    • ${version.patch} the patch version component of ${version} e.g. '3'
      • ${version.patch.next} the ${version.patch} increased by 1 e.g. '4'
    • ${version.label} the version label of ${version} e.g. 'SNAPSHOT'
      • ${version.label.prefixed} like ${version.label} with label separator e.g. '-SNAPSHOT'
  • Project Version Pattern Groups

    • Content of regex groups in projectVersionPattern can be addressed like this:

    • ${version.GROUP_NAME}

    • ${version.GROUP_INDEX}

    • Named Group Example

      groovy

      projectVersionPattern = '^.+-(?<environment>.+)-SNAPSHOT$'
      branch('main') {
          version = '${version.environment}-SNAPSHOT'
      }

      kotlin

      projectVersionPattern = '^.+-(?<environment>.+)-SNAPSHOT\$'
      branch("main") {
          version = "\${version.environment}-SNAPSHOT"
      }

  • ${ref} ${ref.slug} ref name (branch or tag name or commit hash)

  • Ref Pattern Groups

    • Content of regex groups in branch/tag pattern can be addressed like this:

    • ${ref.GROUP_NAME} ${ref.GROUP_NAME.slug}

    • ${ref.GROUP_INDEX} ${ref.GROUP_INDEX.slug}

    • Named Group Example

      groovy

      branch('feature/(?<feature>.+)') {
          version = '${ref.feature}-SNAPSHOT'
      }

      kotlin

      branch("feature/(?<feature>.+)") {
          version = "\${ref.feature}-SNAPSHOT"
      }

  • ${commit} commit hash '0fc20459a8eceb2c4abb9bf0af45a6e8af17b94b'

  • ${commit.short} commit hash (7 characters) e.g. '0fc2045'

  • ${commit.timestamp} commit timestamp (epoch seconds) e.g. '1560694278'

  • ${commit.timestamp.year} commit year e.g. '2021'

  • ${commit.timestamp.year.2digit} 2-digit commit year.g. '21'

  • ${commit.timestamp.month} commit month of year e.g. '12'

  • ${commit.timestamp.day} commit day of month e.g. '23'

  • ${commit.timestamp.hour} commit hour of day (24h)e.g. '13'

  • ${commit.timestamp.minute} commit minute of hour e.g. '59'

  • ${commit.timestamp.second} commit second of minute e.g. '30'

  • ${commit.timestamp.datetime} commit timestamp formatted as yyyyMMdd.HHmmsse.g. '20190616.161442'

  • ${describe} Will resolve to git describe --tags --first-parent output

  • ${describe.distance} The distance count to last matching tag

  • ${describe.tag} The matching tag of git describe

    • ${describe.tag.version} the tag version determined by regex \d+\.\d+\.\d+
      • ${describe.tag.version.core} the core version component of ${describe.tag.version} e.g. '1.2.3'
      • ${describe.tag.version.major} the major version component of ${describe.tag.version} e.g. '1'
        • ${describe.tag.version.major.next} the ${describe.tag.version.major} increased by 1 e.g. '2'
      • ${describe.tag.version.minor} the minor version component of ${describe.tag.version} e.g. '2'
        • ${describe.tag.version.minor.next} the ${describe.tag.version.minor} increased by 1 e.g. '3'
      • ${describe.tag.version.patch} the patch version component of ${describe.tag.version} e.g. '3'
        • ${describe.tag.version.patch.next} the ${describe.tag.version.patch} increased by 1 e.g. '4'
        • ${describe.tag.version.patch.next.plus.describe.distance} the ${describe.tag.version.patch.next} increased by ${describe.distance} e.g. '3'
        • ${describe.tag.version.patch.plus.describe.distance} the ${describe.tag.version.patch} increased by ${describe.distance} e.g. '2'
      • ${describe.tag.version.label} the label version component of ${describe.tag.version} e.g. 'SNAPSHOT'
        • ${describe.tag.version.label.next} the ${describe.tag.version.label} converted to an integer and increased by 1 e.g. '6'
        • ${describe.tag.version.label.next.plus.describe.distance} the ${describe.tag.version.label.next} increased by ${describe.distance} e.g. '3'
        • ${describe.tag.version.label.plus.describe.distance} the ${describe.tag.version.label} increased by ${describe.distance} e.g. '2'
  • Describe Tag Pattern Groups

    • Content of regex groups in describeTagPattern can be addressed like this:

    • ${describe.tag.GROUP_NAME} ${describe.tag.GROUP_NAME.slug}

    • ${describe.tag.GROUP_INDEX} ${describe.tag.GROUP_INDEX.slug}

    • Named Group Example

      groovy

      branch('main') {
          describeTagPattern = 'v(?<version>.*)'
          version = '${ref.feature}-SNAPSHOT'
      }

      kotlin

      branch("main") {
          describeTagPattern = "v(?<version>.*)"
          version = "\${describe.tag.version}-SNAPSHOT"
      }

  • ${dirty} If repository has untracked files or uncommitted changes this placeholder will resolve to -DIRTY, otherwise it will resolve to an empty string.

    • ⚠️ Can lead to performance issue on very large projects (10,000+ files)
  • ${dirty.snapshot} Like ${dirty}, but will resolve to -SNAPSHOT

  • ${value} Original value of matching property (Only available within property format)

Parameters & Environment Variables

  • Disable Extension

    • Environment Variables
    • export VERSIONING_DISABLE=true
    • Command Line Parameters
    • gradle … -Dversioning.disable
  • Set branch or Add tag by environment variable

    • Environment Variables
    • export VERSIONING_GIT_REF=$PROVIDED_REF e.g. refs/heads/main, refs/tags/v1.0.0 or refs/pull/1000/head
    • export VERSIONING_GIT_BRANCH=$PROVIDED_BRANCH_NAME e.g. main or refs/heads/main
    • export VERSIONING_GIT_TAG=$PROVIDED_TAG_NAME e.g. v1.0.0 or refs/tags/v1.0.0
    • Command Line Parameters
    • gradle … -Dgit.ref=$PROVIDED_REF
    • gradle … -Dgit.branch=$PROVIDED_BRANCH_NAME
    • gradle … -Dgit.tag=$PROVIDED_TAG_NAME

    ℹ Especially useful for CI builds see Miscellaneous Hints

  • Update gradle.properties file

    • Environment Variables
    • export VERSIONING_UPDATE_GRADLE_PROPERTIES=true
    • Command Line Parameters
    • gradle … -Dversioning.updateGradleProperties

Provided Project Properties

  • git.commit e.g. '0fc20459a8eceb2c4abb9bf0af45a6e8af17b94b'

  • git.commit.short e.g. '0fc2045'

  • git.commit.timestamp e.g. '1560694278'

  • git.commit.timestamp.datetime e.g. '2019-11-16T14:37:10Z'

  • git.ref git.ref.slug HEAD ref name (branch or tag name or commit hash)


Gradle Tasks

  • version
    • Print project version e.g. gradle :version -q

CI/CD Setup

Most CI/CD systems do checkouts in a detached HEAD state so no branch information is available, however they provide environment variables with this information. You can provide those, by using Parameters & Environment Variables.

Native Support

  • GitHub Actions: if $GITHUB_ACTIONS == true, GITHUB_REF is considered
  • GitLab CI: if $GITLAB_CI == true, CI_COMMIT_BRANCH, CI_COMMIT_TAG and CI_MERGE_REQUEST_SOURCE_BRANCH_NAME are considered
  • Circle CI: if $CIRCLECI == true, CIRCLE_BRANCH and CIRCLE_TAG are considered
  • Jenkins: if JENKINS_HOME is set, BRANCH_NAME and TAG_NAME are considered

Manual Setup

Set following environment variables before running your gradle command

export VERSIONING_GIT_REF=$PROVIDED_REF;

$PROVIDED_REF value examples: refs/heads/main, refs/tags/v1.0.0 or refs/pull/1000/head

or

export VERSIONING_GIT_BRANCH=$PROVIDED_BRANCH;
export VERSIONING_GIT_TAG=$PROVIDED_TAG;

$PROVIDED_BRANCH value examples: main, refs/heads/main or refs/pull/1000/head

$PROVIDED_TAG value examples: v1.0.0 or refs/tags/v1.0.0


Miscellaneous Hints

Commandline To Print Project Version

gradle :version -q


Build & Release

 # Publishes this plugin to local Maven
  ./gradlew build publishToMavenLocal
  # Publishes this plugin to Gradle Plugin portal.
  ./gradlew login && ./gradlew publishPlugins

gradle-git-versioning-plugin's People

Contributors

asemy avatar dependabot[bot] avatar jezprime-trp avatar qoomon avatar rscharer avatar sf-emaino avatar taichi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gradle-git-versioning-plugin's Issues

Request: replace string-based templating with lambda parameters, so I can programatically create the version

At the moment the version is constructed based on a static string template. The plugin will do a find/replace in the version string for format placeholders, and replace them with existing format placeholder values.

However I would like to dynamically select the version, based on the format placeholder values. For example:

If CODEBUILD_WEBHOOK_TRIGGER is not available, then use the 'ref' placeholder.

version = "0.0.0-SNAPSHOT"
gitVersioning.apply {
    refs {
        branch(".+") {
            // if the env-var is unavailable, use the 'ref'
            version = "\${commit.timestamp.datetime}-\${env.CODEBUILD_WEBHOOK_TRIGGER.slug:-\${ref}}"
        }
    }
    rev { version = "\${commit.timestamp.datetime}-\${commit}" }
}

This resolves to

20220425.112958-${ref}

But I want it to be

20220425.112958-feat-add-widget

Suggestion

Perhaps the find/replace can be made more intelligent, but I'd recommend an alternative. Remove the string templating, and provide the git variables as parameters to the existing action.

public void branch(String pattern, Action<RefPatchDescription> action) {
RefPatchDescription ref = new RefPatchDescription(BRANCH, Pattern.compile(pattern));
action.execute(ref);
this.list.add(ref);
}

        public void branch(String pattern, Action<GitProperties, RefPatchDescription> action) {
            RefPatchDescription ref = new RefPatchDescription(BRANCH, Pattern.compile(pattern));
            // action.execute(ref); // don't execute immediately, evaluate it later, once the git properties are determined
            this.list.add(action);
        }
        
         // when required, evaluate the version
        public RefPatchDescription evaluateVersion() {
            for (var Action<> action in list) {
                return action.invoke(gitProperties)
            }
        }

(I'm not sure on the correct Action class to use, but in this case GitProperties would be provided as an argument and the Action must return a RefPatchDescription.

In build.gradle.kts it would be used something like this

version = "0.0.0-SNAPSHOT"
gitVersioning.apply {
    // List of ref configurations, ordered by priority. First matching configuration will be used.
    refs {
        branch(".+") { gitProperties ->
            var gitRef = gitProperties.env("CODEBUILD_WEBHOOK_TRIGGER")
            if (gitRef.isNullOrBlank()) gitRef = gitProperties.ref()
            version = "${gitProperties.commit.timestamp.datetime}-${gitRef}"
        }
    }
    rev { gitProperties -> 
      version = "${gitProperties.commit.timestamp.datetime}-${gitProperties.commit}" }
}

Other points

A quick question, rather than making a ticket just for for it, I am confused by this line

- `refs` List of ref configurations, ordered by priority.

Is it ordered by ascending priority, as in the first definition will be overridden by later definition, if they match?

Placeholder - number of commits after tag and/or parent branch

Hello.

Have your ever thought about placeholders with numbers after some events?

Like 5 commits after last tag in current branch or 5 commits from "parent" branch?

it could be usefull in feature-branches to determinate "freshness" of the build or range from main-branch. also for develop branch - to see progress from last release. and so on.

${describe.tag} behaviour inconsistent with $(git describe)

${describe.tag} chooses the first tag in the alphabetical order, instead of the latest one, like git describe does.

Steps to reproduce:

  1. Create tag a
  2. Create tag b
  3. Use the following git versioning config:
gitVersioning.apply {
    rev {
        version = '${describe.tag}'
    }
}

Actual behaviour:
./gradlew :version returns a. git describe returns b.

Expected behaviour:
./gradlew :version returns b.

Tested on the plugin version 6.1.1.

Kotlin DSL documentation leads to Unmatched closing ')'

if i just copy and paste the example from the README.md

i get a org.gradle.internal.exceptions.LocationAwareException

i think it's because the pattern for the "/pull" prefix is invalid:

branch(closureOf<VersionDescription>{
        pattern = "pull/.+)"
        versionFormat = "\${branch}-SNAPSHOT"
})

leads to: Unmatched closing ')' near index 6 pull/.+)

think it should be like:

branch(closureOf<VersionDescription>{
        pattern = "pull/(.+)"
        versionFormat = "\${branch}-SNAPSHOT"
})

works for me at least :D


Full stacktrace:

Unmatched closing ')' near index 6
pull/.+)
      ^
	at org.gradle.kotlin.dsl.execution.InterpreterKt$locationAwareExceptionFor$2.invoke(Interpreter.kt:558)
	at org.gradle.kotlin.dsl.execution.InterpreterKt.locationAwareExceptionFor(Interpreter.kt:565)
	at org.gradle.kotlin.dsl.execution.InterpreterKt.locationAwareExceptionHandlingFor(Interpreter.kt:531)
	at org.gradle.kotlin.dsl.execution.InterpreterKt.access$locationAwareExceptionHandlingFor(Interpreter.kt:1)
	at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost.handleScriptException(Interpreter.kt:381)
	at Program.execute(Unknown Source)

Licence

Hey, thanks for publishing this project. Please say under which license can community use it.

limit the version string length by configuration

is there a way to limit the generated version string?

situation:

example:

version of a branch with a verry long branchname: MY-TICKETID-123456_testing-deployment-with-a-verry-long-branch-name-SNAPSHOT (more than 63 cahrs)

expected:

  • provide a configuration to limit max length of the resulting string and cut the last characters of the branchname, example:
    versionMaxLenght=63

result: MY-TICKETID-123456_testing-deployment-with-a-verry-lon-SNAPSHOT (63 characters, branchname + '-SNAPSHOT')

would be awesome to have something like this :)

update guide to include Jenkins pipeline example

could it be possible to add a section in the guide : How to add that to our project in Jenkins pipeline ?

I'm using jenkins in Kubernetes. We could use a maven-agent, but don't know how to package the extension in it, or maybe use a global library and call it from our pipeline.

I would like to call that script to update my pom.xml version when I receive a webhook about a new branch was created. Like that I'll be sure that all my branches doesn't have the same artifact version

Plugin does not detect merged tags

Consider the following git branch and merge history:

image

git describe --tags correctly returns the merged 1.1.0 tag, however running the plugin with gradlew version -q only detects the initial 0.0.1 tag.

org.eclipse.jgit.errors.MissingObjectException: Missing unknown <commit hash here>

Hello! I love the plugin!

I'm utilizing it in a project being built by Bamboo and I'm running into a few issues. Here's details about the setup:

Build Environment Details

  • Java 11
  • Gradle 8.0
  • gradle-git-versioning-plugin 6.4.2

Vesioning configuration

gitVersioning.apply {
    refs {
        considerTagsOnBranches = true
        //Tags will be used explicitly, e.g. 1.0.0
        tag("(?<version>.*)") {
            version = "\${ref.version}"
        }
        //release/1.0.0   -> 1.0.0-SNAPSHOT
        //hotfix/1.0.1    -> 1.0.1-SNAPSHOT
        branch("(release|hotfix)/(?<release>.+)") {
            version = "\${ref.release}-SNAPSHOT"
        }
        //Branch names will be used explicitly
        branch(".+") {
            version = "\${ref}-SNAPSHOT"
        }
    }

    // optional fallback configuration in case of no matching ref configuration
    rev {
        version = "\${commit}"
    }

Git details

  • Branch being built: release/1.0.0
    • Git log: commit be04be543a5a53322172473b2ab26a26c93a6187 (HEAD -> release/1.0.0, origin/release/1.0.0)

Build Output

During the build, the following log details are output:

Starting task 'Checkout Default Repository' of type 'com.atlassian.bamboo.plugins.vcs:task.vcs.checkout'
Checking out into /home/bamboo-agent-home/xml-data/build-dir/JS-LDB0-JOB1
Updating source code to revision: be04be543a5a53322172473b2ab26a26c93a6187
Fetching 'refs/heads/release/1.0.0' from 'ssh://[email protected]:7999/js/myreponame.git'.
Checking out revision be04be543a5a53322172473b2ab26a26c93a6187.
Creating local git repository in '/home/bamboo-agent-home/xml-data/build-dir/JS-LDB0-JOB1/.git'.
Cloning into '/home/bamboo-agent-home/xml-data/build-dir/JS-LDB0-JOB1'...
done.
Switched to a new branch 'release/1.0.0'
Branch release/1.0.0 set up to track remote branch release/1.0.0 from origin.
Updated source code to revision: be04be543a5a53322172473b2ab26a26c93a6187
Finished task 'Checkout Default Repository' with result: Success

The build then attempts to run the following:

export VERSIONING_GIT_BRANCH=${bamboo.planRepository.branchDisplayName}

echo branchDisplayName ${bamboo.planRepository.branchDisplayName}
echo revision ${bamboo.planRepository.revision}

./gradlew --stacktrace check clean build

The following is the output:

branchDisplayName release/1.0.0
revision be04be543a5a53322172473b2ab26a26c93a6187
Downloading https://services.gradle.org/distributions/gradle-8.0-bin.zip
...........10%............20%............30%............40%............50%............60%...........70%............80%............90%............100%

Welcome to Gradle 8.0!

For more details see https://docs.gradle.org/8.0/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :
matching ref: BRANCH - release/1.0.0
ref configuration: BRANCH - pattern: (release|hotfix)/(?<release>.+)
  version: ${ref.release}-SNAPSHOT

FAILURE: Build failed with an exception.

* Where:
Build file '/home/bamboo-agent-home/xml-data/build-dir/JS-LDB0-JOB1/build.gradle' line: 58

* What went wrong:
A problem occurred evaluating root project 'myprojectname'.
> org.eclipse.jgit.errors.MissingObjectException: Missing unknown be04be543a5a53322172473b2ab26a26c93a6187

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'myprojectname'.
	at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.lambda$apply$0(DefaultScriptPluginFactory.java:135)
	at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:79)
	at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:138)
	at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.configuration.BuildOperationScriptPlugin.lambda$apply$0(BuildOperationScriptPlugin.java:62)
	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
	at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:62)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:388)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:406)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:387)
	at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:42)
	at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
	at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:35)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.lambda$run$0(LifecycleProjectEvaluator.java:109)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$applyToMutableState$0(DefaultProjectStateRegistry.java:388)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.lambda$fromMutableState$1(DefaultProjectStateRegistry.java:411)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withReplacedLocks(DefaultWorkerLeaseService.java:345)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.fromMutableState(DefaultProjectStateRegistry.java:411)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.applyToMutableState(DefaultProjectStateRegistry.java:387)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$EvaluateProject.run(LifecycleProjectEvaluator.java:100)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:72)
	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:792)
	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:156)
	at org.gradle.api.internal.project.ProjectLifecycleController.lambda$ensureSelfConfigured$2(ProjectLifecycleController.java:84)
	at org.gradle.internal.model.StateTransitionController.lambda$doTransition$13(StateTransitionController.java:247)
	at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:258)
	at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:246)
	at org.gradle.internal.model.StateTransitionController.lambda$maybeTransitionIfNotCurrentlyTransitioning$10(StateTransitionController.java:207)
	at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:34)
	at org.gradle.internal.model.StateTransitionController.maybeTransitionIfNotCurrentlyTransitioning(StateTransitionController.java:203)
	at org.gradle.api.internal.project.ProjectLifecycleController.ensureSelfConfigured(ProjectLifecycleController.java:84)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$ProjectStateImpl.ensureConfigured(DefaultProjectStateRegistry.java:362)
	at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:33)
	at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:47)
	at org.gradle.configuration.DefaultProjectsPreparer.prepareProjects(DefaultProjectsPreparer.java:42)
	at org.gradle.configuration.BuildTreePreparingProjectsPreparer.prepareProjects(BuildTreePreparingProjectsPreparer.java:64)
	at org.gradle.configuration.BuildOperationFiringProjectsPreparer$ConfigureBuild.run(BuildOperationFiringProjectsPreparer.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.configuration.BuildOperationFiringProjectsPreparer.prepareProjects(BuildOperationFiringProjectsPreparer.java:40)
	at org.gradle.initialization.VintageBuildModelController.lambda$prepareProjects$2(VintageBuildModelController.java:84)
	at org.gradle.internal.model.StateTransitionController.lambda$doTransition$13(StateTransitionController.java:247)
	at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:258)
	at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:246)
	at org.gradle.internal.model.StateTransitionController.lambda$transitionIfNotPreviously$11(StateTransitionController.java:221)
	at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:34)
	at org.gradle.internal.model.StateTransitionController.transitionIfNotPreviously(StateTransitionController.java:217)
	at org.gradle.initialization.VintageBuildModelController.prepareProjects(VintageBuildModelController.java:84)
	at org.gradle.initialization.VintageBuildModelController.prepareToScheduleTasks(VintageBuildModelController.java:71)
	at org.gradle.internal.build.DefaultBuildLifecycleController.lambda$prepareToScheduleTasks$3(DefaultBuildLifecycleController.java:134)
	at org.gradle.internal.model.StateTransitionController.lambda$doTransition$13(StateTransitionController.java:247)
	at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:258)
	at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:246)
	at org.gradle.internal.model.StateTransitionController.lambda$maybeTransition$9(StateTransitionController.java:198)
	at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:34)
	at org.gradle.internal.model.StateTransitionController.maybeTransition(StateTransitionController.java:194)
	at org.gradle.internal.build.DefaultBuildLifecycleController.prepareToScheduleTasks(DefaultBuildLifecycleController.java:132)
	at org.gradle.internal.buildtree.DefaultBuildTreeWorkPreparer.scheduleRequestedTasks(DefaultBuildTreeWorkPreparer.java:36)
	at org.gradle.configurationcache.VintageBuildTreeWorkController$scheduleAndRunRequestedTasks$1.apply(VintageBuildTreeWorkController.kt:36)
	at org.gradle.configurationcache.VintageBuildTreeWorkController$scheduleAndRunRequestedTasks$1.apply(VintageBuildTreeWorkController.kt:35)
	at org.gradle.composite.internal.DefaultIncludedBuildTaskGraph.withNewWorkGraph(DefaultIncludedBuildTaskGraph.java:109)
	at org.gradle.configurationcache.VintageBuildTreeWorkController.scheduleAndRunRequestedTasks(VintageBuildTreeWorkController.kt:35)
	at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$scheduleAndRunTasks$1(DefaultBuildTreeLifecycleController.java:68)
	at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.lambda$runBuild$4(DefaultBuildTreeLifecycleController.java:98)
	at org.gradle.internal.model.StateTransitionController.lambda$transition$6(StateTransitionController.java:177)
	at org.gradle.internal.model.StateTransitionController.doTransition(StateTransitionController.java:258)
	at org.gradle.internal.model.StateTransitionController.lambda$transition$7(StateTransitionController.java:177)
	at org.gradle.internal.work.DefaultSynchronizer.withLock(DefaultSynchronizer.java:44)
	at org.gradle.internal.model.StateTransitionController.transition(StateTransitionController.java:177)
	at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.runBuild(DefaultBuildTreeLifecycleController.java:95)
	at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.scheduleAndRunTasks(DefaultBuildTreeLifecycleController.java:68)
	at org.gradle.internal.buildtree.DefaultBuildTreeLifecycleController.scheduleAndRunTasks(DefaultBuildTreeLifecycleController.java:63)
	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:31)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.internal.buildtree.ProblemReportingBuildActionRunner.run(ProblemReportingBuildActionRunner.java:49)
	at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:65)
	at org.gradle.tooling.internal.provider.FileSystemWatchingBuildActionRunner.run(FileSystemWatchingBuildActionRunner.java:140)
	at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:41)
	at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.lambda$execute$0(RootBuildLifecycleBuildActionExecutor.java:40)
	at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:122)
	at org.gradle.launcher.exec.RootBuildLifecycleBuildActionExecutor.execute(RootBuildLifecycleBuildActionExecutor.java:40)
	at org.gradle.internal.buildtree.DefaultBuildTreeContext.execute(DefaultBuildTreeContext.java:40)
	at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.lambda$execute$0(BuildTreeLifecycleBuildActionExecutor.java:65)
	at org.gradle.internal.buildtree.BuildTreeState.run(BuildTreeState.java:53)
	at org.gradle.launcher.exec.BuildTreeLifecycleBuildActionExecutor.execute(BuildTreeLifecycleBuildActionExecutor.java:65)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:61)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor$3.call(RunAsBuildOperationBuildActionExecutor.java:57)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionExecutor.execute(RunAsBuildOperationBuildActionExecutor.java:57)
	at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.lambda$execute$0(RunAsWorkerThreadBuildActionExecutor.java:36)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249)
	at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109)
	at org.gradle.launcher.exec.RunAsWorkerThreadBuildActionExecutor.execute(RunAsWorkerThreadBuildActionExecutor.java:36)
	at org.gradle.tooling.internal.provider.continuous.ContinuousBuildActionExecutor.execute(ContinuousBuildActionExecutor.java:110)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecutor.execute(SubscribableBuildActionExecutor.java:64)
	at org.gradle.internal.session.DefaultBuildSessionContext.execute(DefaultBuildSessionContext.java:46)
	at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:100)
	at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter$ActionImpl.apply(BuildSessionLifecycleBuildActionExecuter.java:88)
	at org.gradle.internal.session.BuildSessionState.run(BuildSessionState.java:69)
	at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:62)
	at org.gradle.tooling.internal.provider.BuildSessionLifecycleBuildActionExecuter.execute(BuildSessionLifecycleBuildActionExecuter.java:41)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:63)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:50)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:38)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:47)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:31)
	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:65)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
	at org.gradle.util.internal.Swapper.swap(Swapper.java:38)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:64)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:84)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
Caused by: java.lang.RuntimeException: org.eclipse.jgit.errors.MissingObjectException: Missing unknown be04be543a5a53322172473b2ab26a26c93a6187
	at me.qoomon.gitversioning.commons.Lazy.get(Lazy.java:24)
	at me.qoomon.gitversioning.commons.GitSituation.getTimestamp(GitSituation.java:56)
	at me.qoomon.gradle.gitversioning.GitVersioningPluginExtension.generateGitProjectProperties(GitVersioningPluginExtension.java:627)
	at me.qoomon.gradle.gitversioning.GitVersioningPluginExtension.apply(GitVersioningPluginExtension.java:151)
	at me.qoomon.gradle.gitversioning.GitVersioningPluginExtension.apply(GitVersioningPluginExtension.java:79)
	at me.qoomon.gradle.gitversioning.GitVersioningPluginExtension.apply(GitVersioningPluginExtension.java:73)
	at me.qoomon.gradle.gitversioning.GitVersioningPluginExtension_Decorated.apply(Unknown Source)
	at me.qoomon.gradle.gitversioning.GitVersioningPluginExtension_Decorated$apply.call(Unknown Source)
	at build_8tae4cwgx664h2dx6g0lucy1o.run(/home/bamboo-agent-home/xml-data/build-dir/JS-LDB0-JOB1/build.gradle:58)
	at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
	... 162 more
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown be04be543a5a53322172473b2ab26a26c93a6187
	at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:135)
	at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:214)
	at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:1081)
	at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:992)
	at org.eclipse.jgit.lib.Repository.parseCommit(Repository.java:1230)
	at me.qoomon.gitversioning.commons.GitUtil.revTimestamp(GitUtil.java:125)
	at me.qoomon.gitversioning.commons.GitSituation.timestamp(GitSituation.java:149)
	at me.qoomon.gitversioning.commons.Lazy.get(Lazy.java:22)
error	15-Nov-2023 14:31:50		... 171 more

Conclusion

The following portion of the stacktrace appears to be most relevant:

Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing unknown be04be543a5a53322172473b2ab26a26c93a6187
	at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:135)
	at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:214)
	at org.eclipse.jgit.revwalk.RevWalk.parseAny(RevWalk.java:1081)
	at org.eclipse.jgit.revwalk.RevWalk.parseCommit(RevWalk.java:992)
	at org.eclipse.jgit.lib.Repository.parseCommit(Repository.java:1230)
	at me.qoomon.gitversioning.commons.GitUtil.revTimestamp(GitUtil.java:125)
	at me.qoomon.gitversioning.commons.GitSituation.timestamp(GitSituation.java:149)
	at me.qoomon.gitversioning.commons.Lazy.get(Lazy.java:22)

The above points to https://github.com/qoomon/gradle-git-versioning-plugin/blob/master/src/main/java/me/qoomon/gitversioning/commons/GitUtil.java#L123.

It seems, for some reason, the jgit plugin isn't able to find the specific git commit object (be04be543a5a53322172473b2ab26a26c93a6187) even though that is the current commit hash. I'm not sure where to go from here.

Improve compatibility with Gradle Configuration Cache

I have Gradle Configuration Cache enabled. When I run ./gradlew version I get a warning.

1 problem was found storing the configuration cache.
- Task `:version` of type `me.qoomon.gradle.gitversioning.VersionTask`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/7.5.1/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

This is because of the use of a Gradle Project instance during execution-time

@TaskAction
void printVersion() {
System.out.println(getProject().getVersion());
}

https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

This instance should be easy to fix by creating an @Input val projectVersion: Property<String> that is set with a convention of the project's version - but maybe there are other usages of Project during execution time.

Shortcut for next version bumped by major/minor/patch

For commits after the release tag (e.g. v1.4.4), we would like to have the next version proposed with SNAPSHOT (e.g. 1.4.5-SNAPSHOT). Currently, it is required to write:

refs {
    branch('master') {
        version = '${describe.tag.version.major}-${describe.tag.version.minor}-${describe.tag.version.patch.next}-SNAPSHOT'
    }
...

while:

        version = '${describe.tag.version.nextPatch}-SNAPSHOT'    //doesn't work

would be more convenient (together the variant for minor and major).

Unfortunately, the naming (e.g. nextMinor) doesn't match the already using naming convention. version.next.patch would be better, but people might expect to have the patch number from the next version. WDYT about adding something lilke that?


As a bonus (might be a separate issues, if preffered), in that approach, having the patch version usually bumped, it could be useful to from time to time release the bigger library update (e.g. 1.4.4 → 2.0.0). With nextPatch (and others) it would be problematic on CI. Maybe there could be also just version.next available to bump patch digit by default (probably configurable by the user), but with the ability to override which value should be bumped with next (with Gradle property or anything sensible for the CI environment). WDYT?

Update. After thinking about that, the bonus part doesn't seem to be crucial as the release version is taken from the tag, so only the SNAPSHOT versioning is affected, which could be "easily" override with changing the plugin configuration in the feature branch (just for releasing snapshots) and removing the changes before merge to master, followed by the tag creation.

Failed to use tag versioning on master in 1.2.1

I'd like to use tag versioning and commit versioning as failback ( appropriate version descriptions were created in build.gradle), but as per code review repoSituation.getHeadBranch() will return 'master' on master branch, so tag branch will never be executed:

        if (repoSituation.getHeadBranch() != null) {
            // branch versioning
            for (final VersionDescription branchVersionDescription : branchVersionDescriptions) {
                Optional<String> versionBranch = Optional.of(repoSituation.getHeadBranch())
                        .filter(branch -> branch.matches(branchVersionDescription.getPattern()));
                if (versionBranch.isPresent()) {
                    gitRefType = "branch";
                    gitRefName = versionBranch.get();
                    versionDescription = branchVersionDescription;
                    break;
                }
            }
        } else if (!repoSituation.getHeadTags().isEmpty()) {
            // tag versioning
            for (final VersionDescription tagVersionDescription : tagVersionDescriptions) {
                Optional<String> versionTag = repoSituation.getHeadTags().stream()
                        .filter(tag -> tag.matches(tagVersionDescription.getPattern()))
                        .max(comparing(DefaultArtifactVersion::new));
                if (versionTag.isPresent()) {
                    gitRefType = "tag";
                    gitRefName = versionTag.get();
                    versionDescription = tagVersionDescription;
                    break;
                }
            }
        }

So following calling of gradle will always use commit versioning:

$VERSIONING_GIT_TAG=1.10.1 ./gradlew :version -q

By the way, 1.2.1 was not pushed into the github repository

Project property does not exist

in readme, there are provided project properties (git.commit, git.ref ...)

I use the property "git.commit" like this.
attributes "Implementation-Version": project.property("git.commit")

but after update from 4.3.0 to 5.0.0, i got this gradle error

A problem occurred evaluating root project 'test'.
> Could not get unknown property 'git.commit' for root project 'test' of type org.gradle.api.Project.

4.3.0 works well.

Does it work with Java 8?

I'm getting this error:

org/eclipse/jgit/storage/file/FileRepositoryBuilder has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Using the computed version in another task

I'm trying to use this plugin to generate different versioning for my software, mainly docker images.

When I just added the recommended configuration to my gradle plugin, I get jars with the commit.version in the name, as expected, but I don't know how I can use this same version in different tasks, mainly a copy task and to docker (plantir plugin) so I can create images with this version as the tag.

Can you just show an example on how to use the computed version, please?

I tried things, like "${version}" and it didn't work. Always refer to the version = '1.0.0' I have in the build.gradle.

author timestamp & commiter timestamp

Currently properties like commit.timestamp, commit.timestamp.year uses the commit author date (the date when commit was originally made). Can you add a new properties which contains commit date (the date when the commit is being modified)
To keep compatibility with current behavior I suggest to use commit.timestamp, commit.timestamp.year and so on to track author date and new properties like commit.committed.timestamp commit.committed.timestamp.year and so on to track committed date

Get computed version

Hello.

If would be great if this plugin will provide a method to get computed "version" as gradle-git-version-calculator does.
I use this version to set some manifest properties.

error message: Object [full hash of commit] is not a commit.

Hi,

first of all: thanks a lot for your gradle plugin. So far, it did exactly what I needed!

Now, however, I experience an error when executing the plugin as part of my build.gradle:

Object [full hash of commit] is not a commit.
org.eclipse.jgit.errors.IncorrectObjectTypeException: Object [full hash of commit] is not a commit.

This error pops up in my CI build on github and started once I did the following:

  • pre-released a version v0.0.X
  • edited said version v0.0.X and changed it to a release

I searched the internet for the error message and came up with this website:
https://paul.wellnerbou.de/2015/06/18/getting-commits-between-annotated-tags-with-jgit/

As I did (pre-)releases on GitHub and changed them after creating them (which I have never done before) around the time I experienced the error for the first time, I guess this is somehow related to the git tagging.

Please let me know if there is anything you need from me to look into this.

uli-f

Using ${version} in a versionFormat with any other macro results in multiple expansion in sub-project

Using ${version} in a versionFormat with any other macro results in multiple expansion.

For example, with the following configuration:

gitVersioning {
    branch {
        pattern = 'master'
        versionFormat = '${version}'
    }
    branch {
        pattern = 'feature/(?<user>.+)/(?<feature>.+)'
        versionFormat = '${version}_${user}_${feature}'
    }
}

With a project where in the root build.gradle.kts has the following:

allprojects {
    version = "0.1"
}

on the master branch, version is "0.1" as expected, but on a feature branch like "features/myuser/myfeature" the version is set to "0.1_myuser_myfeature_myuser_myfeature", where I would expect it to be "0.1_myuser_myfeature"

This problem seems specific to sub-projects. For example, if in the root directory I do "gradlew version", I get "0.1_myuser_myfeature", but if I do "gradlew :subproject:version" I see "0.1_myuser_myfeature_myuser_myfeature"

Tag refs ignored, pattern not recognised

Hello

I tried to use provided example, from readme
My build.gradle.kts looks like below

plugins {
    id("org.springframework.boot") version "3.0.2-SNAPSHOT"
    id("io.spring.dependency-management") version "1.1.0"
    id("org.graalvm.buildtools.native") version "0.9.18"
    kotlin("jvm") version "1.7.22"
    kotlin("plugin.spring") version "1.7.22"
    id("me.qoomon.git-versioning") version "6.3.8"
}

group = "org.example"
version = "0.0.0-SNAPSHOT"
gitVersioning.apply {
    refs {
//        branch(".+") {
//            version = "\${ref}-SNAPSHOT"
//        }
        tag(".+") {
            version = "\${ref}"
        }
    }

    // optional fallback configuration in case of no matching ref configuration
//    rev {
//        version = "\${commit}"
//    }
}

The problem is that the result during run is like below

skip - no matching ref configuration and no rev configuration defined
git refs:
  branch: master
defined ref configurations:
  TAG    - pattern: .+

I went from the original example (including only tag("v(?<version>.+)")), reducing it to the given form.
I am runing this in PowerShell, but in bash for git the result is the same.
Gradle is the newest - 7.6.
Java openjdk 18 (build 18+36-2087)

git describe --tags --first-parent 
v0.0.6

How to define the <VERSION> pattern.

Greetings!

I have a hard time to figure out how to get the Version correctly:

are@archlinux ~/d/s/J/JSQLParser (sphinx)> git describe --tags --always --dirty=-SNAPSHOT
jsqlparser-4.5-64-g08141a35-SNAPSHOT
group = 'com.github.jsqlparser'
version = '4.5'
gitVersioning.apply {

    refs {
        branch('master') {
            describeTagPattern = 'jsqlparser-.+(?<version>.*)'
            version = '${ref}${dirty.snapshot}'
        }
        tag('jsqlparser-.+(?<version>.*)') {
            version = '${ref.version}'
        }
    }

    // optional fallback configuration in case of no matching ref configuration
    rev {
        version = '${ref}${dirty.snapshot}'
    }
}

Does not match the branch and falls back to rev only.
I assume, that <version> expects a x.y.z format, while I have only a x.y format. How can I change that?

Can't find `CommitVersionDescription` after upgrade to 4.0.0 with kotlin dsl

Hello. I have problems with plugin upgrading from 3.0 to 4.0.
Gradle (kotlin dsl) can't find CommitVersionDescription and fails on script compilation.

PR with upgrade: 1c-syntax/bsl-language-server#1544
Build logs: https://github.com/1c-syntax/bsl-language-server/pull/1544/checks?check_run_id=1977036787
build.gradle.kts: https://github.com/1c-syntax/bsl-language-server/blob/dependabot/gradle/me.qoomon.git-versioning-4.0.0/build.gradle.kts#L32-L45

Any thougts?

Fix compatibility with Gradle `8.1` and Configuration Cache

Since Gradle 8.1, any exec command that is not done trough providers is forgiven at configuration time:

FAILURE: Build failed with an exception.

* What went wrong:
Configuration cache problems found in this build.

2 problems were found storing the configuration cache.
- Build file 'plugin/build.gradle.kts': external process started '/opt/homebrew/bin/git --version'
  See https://docs.gradle.org/8.1.1/userguide/configuration_cache.html#config_cache:requirements:external_processes
- Build file 'plugin/build.gradle.kts': external process started '/opt/homebrew/bin/git config --system --show-origin --list -z'
  See https://docs.gradle.org/8.1.1/userguide/configuration_cache.html#config_cache:requirements:external_processes

See the complete report at file:///xxx/configuration-cache-report.html
> Starting an external process '/opt/homebrew/bin/git --version' during configuration time is unsupported.
> Starting an external process '/opt/homebrew/bin/git config --system --show-origin --list -z' during configuration time is unsupported.

Gradle not accepting the version from the plugin

I used the default exemple:

version '0.0.0-SNAPSHOT'
gitVersioning.apply {
    refs {
        branch('.+') {
            version = '${ref}-SNAPSHOT'
        }
        tag('v(?<version>.*)') {
            version= '${ref.version}'
        }
    }

    // optional fallback configuration in case of no matching ref configuration
    rev {
        version = '${commit.short}'
    }
}

When building/run i got this error message:

image

Configuring updateGradleProperties has no effect

When configuring updateGradleProperties directly in the apply block, this setting is never considered.
As the VersionDescription is inialized with updateGradleProperties set to false, the method GitVersioningPluginExtension.getUpdateGradlePropertiesFileOption is always left without considering the property in GitVersioningPluginConfig.

GitLab CI global variable definiton

another documentation improvement for https://github.com/qoomon/gradle-git-versioning-plugin#gitlab-ci-setup

instead of defining the version env variables for each job or using the before_script block, it is possible to define them as "global" variables:

variables:
  VERSIONING_GIT_TAG: ${CI_COMMIT_TAG}
  VERSIONING_GIT_BRANCH: ${CI_COMMIT_BRANCH}

this way the job execution is a bit faster, since the before_script havn't to be executed, if there is nothing else in it and the variables are available in all jobs :)

NPE for lightweight tags

When at least one repository tag is lightweight, GitUtil throws an NPE on line 39. The object is peeled, but there is no peeled id.

How to configure previous tag + -SNAPSHOT using GitHub Actions?

I've tried setting it up but it keeps selecting main-SNAPSHOT

build.gradle.kts config: https://github.com/Kantis/ks3/blob/ee42e3cd3be08dc3c12563c8c5f04d8aa0ae0507/build.gradle.kts#L8-L20

version = "0.0.0-SNAPSHOT"
gitVersioning.apply {
   refs {
      // if git HEAD is attached:
      branch(".+") { version = "\${ref}-SNAPSHOT" }

      // if HEAD is detached:
      tag("v(?<version>.*)") { version = "\${ref.version}" }
   }

   // optional fallback configuration in case of no matching ref configuration
   rev { version = "\${commit}" }
}

Here's the GHA, trigged from a commit on the main branch: https://github.com/Kantis/ks3/actions/runs/3327175830

There is a tag, v0.0.1, on main branch https://github.com/Kantis/ks3/releases/tag/v0.0.1

However git-versioning-plugin picks the version as 'main-SNAPSHOT' https://github.com/Kantis/ks3/actions/runs/3327175830/jobs/5501672555#step:6:310

https://github.com/Kantis/ks3/blob/ee42e3cd3be08dc3c12563c8c5f04d8aa0ae0507/.github/workflows/release.yaml#L19-L49

considerTagsOnBranches works only if tags config is before branch config

Hello!
Plugin version 5.1.0.

$subject :)

You can check this two commits:

  1. initial setup after upgrading from 4.x version: https://github.com/1c-syntax/bsl-language-server/blob/7001455067a182e4fb85795ea437ca43d92d5f5e/build.gradle.kts#L30-L44 (develop branch some time ago)
    If you checkout develop pointing to this commit, try to put some tag (like v123) and run ./gradlew jar, you'll see that jar recieves name matching "branch" configuration (bsl-language-server-develop-7001455.jar)
  2. Swap tag and branch config - 1c-syntax/bsl-language-server@868d5c4 - and jar recieves correct name (bsl-language-server-123.jar).

It's not a big problem, but looks like a reggression compared with 4.x

properties.put does not set property

properties.put does not set property

Steps to reproduce:
build.gradle

plugins {
    id 'me.qoomon.git-versioning' version '5.1.1'
}
ext.x = 'abc'
gitVersioning.apply {
    refs {
        branch('.*') {
            properties.put('x','cde')
	}
    }
}

task printProp {
 doLast { println "x=$x" }
}

The output (some unimportant lines was deleted)

$ ./gradlew -i printProp
> Configure project :
....
matching ref: BRANCH - master
ref configuration: BRANCH - pattern: .*
  describeTagPattern: .*
All projects evaluated.
...
> Task :printProp
....
x=abc

When the properties are set directly all is ok

plugins {
    id 'me.qoomon.git-versioning' version '5.1.1'
}
ext.x = 'abc'
gitVersioning.apply {
    refs {
        branch('.*') {
            properties = ['x':'cde']
        }
    }
}

task printProp {
 doLast { println "x=$x" }
}

The output

> Configure project :
matching ref: BRANCH - master
ref configuration: BRANCH - pattern: .*
  describeTagPattern: .*
  properties: null
    x - cde
properties:
set property x to cde
All projects evaluated.
> Task :printProp
x=cde

[6.1.0] `./gradlew version` fails with "invalid provided ref nkiesel/main/StringBuilder - needs to start with refs/"

I wanted to add the branch name to my version. I started with

    gitVersioning.apply {
        refs {
            branch('.+') {
                version = '${version}-test'
            }
        }
    }

in a repo where the current branch name is nkiesel/main/StringBuilder, but that fails with "invalid provided ref nkiesel/main/StringBuilder - needs to start with refs/". If I replace .+ with m.+ (i.e. the pattern no longer matcheds the current branch name), ./gradew version works and prints

Configuration on demand is an incubating feature.

> Configure project :
skip - no matching ref configuration and no rev configuration defined
git refs:
  branch: nkiesel/main/StringBuilder
  tags: []
defined ref configurations:
  BRANCH - pattern: m.+
skip - no matching ref configuration and no rev configuration defined
...

I tried different branch names, but that does not seem to make a difference.

LATEST version could not be found

The 'LATEST' version couldn't be found, but version 1.2.3 can be found. Is the LATEST in another plugin repository?

* What went wrong:
Plugin [id: 'me.qoomon.git-versioning', version: 'LATEST'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'me.qoomon.git-versioning:me.qoomon.git-versioning.gradle.plugin:LATEST')
  Searched in the following repositories:
    Gradle Central Plugin Repository

Document that this plugin should be applied at the root project

I accidentally applied it via allprojects block and got this error:

 Cannot add task 'version' as a task with that name already exists

So apparently, when applied to the subproject, this plugin searches for the root project and adds version task to it. In case of multiple projects, it attempts to add the same task twice.

JVM compatibility error in buildSrc

Hi, I've just updated to v6.1.1 and I'm getting an error

./gradlew version -q

FAILURE: Build failed with an exception.

* What went wrong:
java.lang.UnsupportedClassVersionError: me/qoomon/gradle/gitversioning/GitVersioningPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
> me/qoomon/gradle/gitversioning/GitVersioningPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I see this changed in this commit: 4a7d963

I've set the plugin in my buildSrc/build.gradle.kts

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
  idea
  `kotlin-dsl`
  kotlin("jvm") version "1.6.21"
}


dependencies {
  // ...

  implementation("me.qoomon:gradle-git-versioning-plugin:6.1.1")
}


tasks.withType<KotlinCompile>().configureEach {

  kotlinOptions {
    jvmTarget = "11"
    apiVersion = "1.6"
    languageVersion = "1.6"
  }
}

kotlin {
  jvmToolchain {
    (this as JavaToolchainSpec).languageVersion.set(
        JavaLanguageVersion.of("11")
    )
  }

  kotlinDslPluginOptions {
    jvmTarget.set("11")
  }
}

I've set similar options for the subprojects that have the Kotlin JVM plugin.

I'm not quite sure what's wrong. I've tried a few options.

I think perhaps the best thing to do is for Git Versioning Plugin to set its JVM target to 1.8, so while the plugin requires and is written with 11, it produces class files that are compatible with 1.8.

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_1_8

I'll keep investigating. I'm making this ticket in case there's something I've missed.

Update: it looks like this issue gradle/gradle#18935. Even though I specify 11 in buildSrc/build.gradle.kts it isn't acknowledged, because Gradle uses an embedded version of Kotlin that's bugged. It might be fixed in Gradle 7.5?

Add a Kotlin DSL example

Hi, maybe it's a good idea to add a Kotlin DSL example to the documentation.
I got it working with this setup:

build.gradle.kts

import me.qoomon.gradle.gitversioning.GitVersioningPluginExtension.VersionDescription

plugins {
    id("me.qoomon.git-versioning") version "1.2.3"
}

gitVersioning {
        branch(closureOf<VersionDescription> {
            pattern = ".*"
            versionFormat = "\${branch}-SNAPSHOT"
        })
        tag(closureOf<VersionDescription>{
            pattern = "(?<tagVersion>[0-9].*)"
            versionFormat = "\${tagVersion}"
        })
}

Didn't found a better or easier to read example so far ... :-/

Placeholder default value and describe.tag do not appear compatible

Trying to create a template repository for teams to create projects from and I'm finding that the describe.tag doesn't quite work with the placeholder default values functionality.

My configuration

version = '0.0.0-SNAPSHOT'
gitVersioning.apply {
    refs {
        considerTagsOnBranches = true
        tag('v(?<version>.*)') {
            version = '${ref.version}'
        }
        branch('main') {
            version = '${describe.tag.version.major:-0}.${describe.tag.version.minor:-0}.${describe.tag.version.patch.next:-0}-SNAPSHOT'
        }
        branch('.+') {
            version = '${describe.tag:-0.0.0}-${describe.distance:-1}-SNAPSHOT'
        }
    }
}

If there are no tags currently, this will work fine for the main branch, but I've discovered that describe.tag will return root instead of being replaced with 0.0.0. It seems like it should allow for the placeholder to take over here rather than always returning root in this case. Perhaps that was necessary before the placeholders functionality was available?

My work around is to use the following since it isn't an issue once you try to access the describe.tag.version:

version = '0.0.0-SNAPSHOT'
gitVersioning.apply {
    refs {
        considerTagsOnBranches = true
        tag('v(?<version>.*)') {
            version = '${ref.version}'
        }

        branch('main') {
            version = '${describe.tag.version.major:-0}.${describe.tag.version.minor:-0}.${describe.tag.version.patch.next:-0}-SNAPSHOT'
        }
        branch('.+') {
            version = '${describe.tag.version}-${describe.distance:-1}-SNAPSHOT'
        }
    }
}

So perhaps just a documentation note indicating that describe.tag will always return some value once the repository is not shallow?

Additionally this still breaks when the clone is shallow, and will result in the following:

* What went wrong:
A problem occurred evaluating root project 'develop-java-library-workflows'.
> java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: couldn't find matching tag in shallow git repository

This certainly makes sense if there were no default placeholders, and it's definitely useful to emit that no tag could be found in a shallow git repository, but it feels that with the placeholder with a default value defined that it should gracefully accept the default value instead?

This is mostly an issue with github actions/checkout and reusable workflows where not expecting to do full clones by default, nor is it straight forward to pass env vars to reusable workflows either.

For the moment I'll look at disabling or trying to make those unshallow, though I might try and automatically unshallow a clone with some scripting before the plugin applies.

Clarify docs on ordered selection

I thought I'd make a new ticket, because my first question was more than just a quick answer and I didn't want to clog up the discussion :)

@aSemy: I am confused by this line

- `refs` List of ref configurations, ordered by priority.

Is it ordered by ascending priority, as in the first definition will be overridden by later definition, if they match?

@qoomon: ℹ First matching configuration will be used. from top to bottom. Does that help?

Ah I think I understand my confusion now. Does the ordering refer to just the refs {} and rev {} blocks? Are the contents of the refs {} block also ordered? Because the example in the README...

    refs {
        branch(".+") {
            version = "\${ref}-SNAPSHOT"
        }
        tag("v(?<version>.*)") {
            version = "\${ref.version}"
        }
    }

To me it looks like branch(".+") matches everything, and it's first, so the tag(...) bit won't ever be selected.

describe.tag.version.major couses java.lang.NullPointerException when none tag fit to pattern

There is a problem in newly created repository where is none any tags. When I try to use ${describe.tag.version.major:-0} I receive:

matching ref: BRANCH - feature/test
ref configuration: BRANCH - pattern: feature/(?<text>.+)
  describeTagPattern: v(?<version>\d+\.\d+\.\d+)
  version: ${describe.tag.version.major:-0}.${describe.tag.version.minor.next:-0}.0-${ref.text.slug}

FAILURE: Build failed with an exception.

> java.lang.RuntimeException: java.lang.NullPointerException

My configuration:

gitVersioning.apply {
    describeTagPattern = /v(?<version>\d+\.\d+\.\d+)/
    refs {
        considerTagsOnBranches = true

        branch(/feature\/(?<text>.+)/) {
            version = '${describe.tag.version.major:-0}.${describe.tag.version.minor.next:-0}.0-${ref.text.slug}'
        }
        
        tag(/v(?<version>\d+\.\d+\.\d+)/) {
            version = 's${ref.version}'
        }
        branch('master|master-test') {
            version = '${describe.tag}-${describe.distance}'
        }
    }

    // optional fallback configuration in case of no matching ref configuration
    rev {
        version = '0.0.0'
    }
}

Good to have opportunity to use default value in this case.

Tag version issue with 6.4.0 when running in CircleCI

I am running in an issue upgrading to version 6.4.0. When creating a tag and running into CircleCI, version is resolved as UNKNOWN. However, if I downgrade to my previous version 6.3.6, the tag is resolved correctly in CircleCI. My configuration is as below.

version = "UNKNOWN"

gitVersioning.apply {
    refs {
        tag(".+") {
            version = "\${ref}"
        }
        branch("master") {
            version = "develop"
        }
        branch(".+") {
            version = "\${ref}"
        }
    }
    rev {
        version = "UNKNOWN"
    }
}

6.4.0 logs from build:

gather git situation from Circle CI environment variables: CIRCLE_BRANCH and CIRCLE_TAG
matching ref: COMMIT - 0032a954f455a82b45e0d611c8298d993e394a76
ref configuration: COMMIT - pattern: null
  version: UNKNOWN

6.3.6 logs from build:

gather git situation from Circle CI environment variables: CIRCLE_BRANCH and CIRCLE_TAG
matching ref: TAG - 0.4.0
ref configuration: TAG - pattern: .+
  version: ${ref}
set version to  0.4.0
project version: 0.4.0

Error in gradle configuration with 5.1.3

When i update from 5.1.1 to 5.1.2 or 5.1.3 i get the following error:

Caused by: java.lang.NoClassDefFoundError: org/gradle/util/internal/ConfigureUtil
at me.qoomon.gradle.gitversioning.GitVersioningPluginExtension.apply(GitVersioningPluginExtension.java:66)
at me.qoomon.gradle.gitversioning.GitVersioningPluginExtension$apply.call(Unknown Source)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.