Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Unable to Authenticate #99

@Xerosigma

Description

@Xerosigma

Keep getting "Authentication is required but no CredentialsProvider has been registered"

Using: org.ajoberstar:gradle-git:1.4.0-rc.1

task tagRelease << {

    // Get git username & password from gradle.properties system properties. (systemProp.gitUser / systemProp.gitPass)
    def user = System.getProperty("gitUser", "")
    def pass = System.getProperty("gitPass", "")
    def credentials = new Credentials(user, pass)

    def grgit = Grgit.open(project.file('..'), credentials)
    grgit.tag.add {
        name = android.defaultConfig.versionName
        message = "Release of ${android.defaultConfig.versionName}"
    }

    def pushCmd = grgit.repository.jgit.push()
    result  = pushCmd.call()
    result.each { item ->
        println item
    }
}

Also have the following in gradle.properties

systemProp.org.ajoberstar.grgit.auth.hardcoded.allow=true
systemProp.org.ajoberstar.grgit.auth.username="******"
systemProp.org.ajoberstar.grgit.auth.password="******"

The following furnished the same error:

./gradlew -Prelease.scope=major -Prelease.stage=rc tagRelease -Dorg.ajoberstar.grgit.auth.force=hardcoded

Pushing from CLI works fine:

    def cmd = "git push origin " + android.defaultConfig.versionName
    def proc = cmd.execute()
    proc.waitFor()
    println proc.in.text.trim()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions