Skip to content

Automatic maven username/password extraction from Gradle files #29938

@rarkins

Description

@rarkins

Discussed in #29793

Originally posted by ferinagy June 21, 2024

What would you like help with?

I would like help with my configuration

How are you running Renovate?

Self-hosted

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

Github action - 40.1.12

Please tell us more about your question or problem

We have a gradle project that uses a private maven repository with given credentials to resolve some dependencies:

dependencyResolutionManagement {
    repositories {
        //...
        maven("https://maven.pkg.github.com/<ORG>/<REPO>") {
            credentials {
                username = "..."
                password = "..."
            }
        }
    }
}

Renovate correctly picks up the host and tries to use it to resolve dependencies, but it does not seem to pick up the credentials, as the resolution fails. When adding a host rule, it works:

hostRules: [
  {
    matchHost: "https://maven.pkg.github.com/<ORG>/<REPO>",
    hostType: "maven",
    username: "...",
    password: "..."
  },
]

However, this feels like unnecessary duplication. Would it be possible for Renovate to pick up the credentials from the gradle file?

Logs (if relevant)

Logs

Replace this text with your logs, between the starting and ending triple backticks

Metadata

Metadata

Assignees

No one assigned

    Labels

    manager:gradleGradle package managerpriority-4-lowLow priority, unlikely to be done unless it becomes important to more people

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions