jfrog / artifactory-gradle-plugin

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

Cannot resolve artifacts after upgrading from version 4.9.7 #69

Open robojeff opened 10 months ago

robojeff commented 10 months ago

How can we help?

I need help configuring my gradle build script. Under version 4.9.7 of the plug-in, this configuration worked:

artifactory {

    def artifactoryUser = 'redacted'
    def artifactoryPassword = 'redacted'

    contextUrl = 'https://redacted.jfrog.io/redacted'
    publish {
        repository {
            repoKey = 'redacted-snapshot'
            username = "${artifactoryUser}"
            password = "${artifactoryPassword}"
            maven = true
        }

        defaults {
            publications('mavenJava')
        }
    }
    resolve {
        repository {
            repoKey = 'redacted-release'
            username = "${artifactoryUser}"
            password = "${artifactoryPassword}"
            maven = true
        }
    }
}

After upgrading to version 5.1.6, I have tried to move the resolving functionality to the repositories closure, as directed in the upgrade instructions:

repositories {
    mavenCentral()  // primary repository for 3rd party dependencies
    mavenLocal()    // repository for local publishing via Maven
    maven {
        url "https://redacted.jfrog.io/artifactory/redacted-release/"
        credentials {
            username = "redacted"
            password = "redacted"
        }
    }
}

However, this does not work. I cannot resolve any of our artifacts. I additionally tried adding "artifactUrls" statements to the repository configuration, but these do not work either.

What am I missing here?

yahavi commented 10 months ago

@robojeff Thank you for choosing to use the Artifactory Gradle plugin.

Starting from Version 5, we have discontinued support for resolution repositories. You can find more details about this change at https://github.com/jfrog/artifactory-gradle-plugin#version-5-of-the-gradle-artifactory-plugin-includes-the-following-breaking-changes-compared-to-version-4.

The plugin doesn't disrupt the artifact resolution process, so this problem shouldn't be occurring. Can you please provide more details about the specific error message you're encountering?