jfrog / artifactory-gradle-plugin

JFrog Gradle plugin for Build Info extraction and Artifactory publishing.
Apache License 2.0
21 stars 15 forks source link

5.0.0 bump question #35

Closed Fritzybois closed 1 year ago

Fritzybois commented 1 year ago

How can we help?

Hi, im trying to bump to the newest version but I cant seem to figure out how to deal with the resolve part.

This is how it used to look in 4.32.0

artifactory {
    contextUrl = "${project.properties['artifactory_contextUrl'] ?: System.env.ARTIFACTORY_URL}"
    resolve {
        repository {
            repoKey = version.endsWith('SNAPSHOT') ? 'snapshot-standard' : 'release-standard'
            username = "${project.properties['artifactory_user'] ?: System.env.ARTIFACTORY_USER}"
            password = "${project.properties['artifactory_password'] ?: System.env.ARTIFACTORY_PASSWORD}"
            maven = true
        }
    }
}

I cant figure out how resolve is supposed to be handled in the new version

attiasas commented 1 year ago

Hi @Fritzybois, thank you for opening this issue. the 'resolve' attribute removed. You can follow this documentation for different ways to configure your repositories with Gradle, check out our gradle project examples or you can use this Kotlin snippet and adjust it

repositories { 
    maven {
        // The Artifactory (preferably virtual) repository to resolve from 
        url = uri("http://repo.myorg.com/artifactory/libs-releases")
        // Optional resolver credentials (leave out to use anonymous resolution)
        credentials {
            // Artifactory's username
            username = "resolver"
            // Password or API Key
            password = "resolverPaS*" 
        } 
    }
  }
Fritzybois commented 1 year ago

Thanks, think we managed to figure it out by using what you suggested.