Repository containing Gradle Artifacts

Gradle’s artifacts used to be published here: https://repo.gradle.org/gradle/libs-releases-local/org/gradle/

Starting with Gradle 6.2, it looks like Gradle’s artifacts are no longer published: https://repo.gradle.org/gradle/libs-releases-local/org/gradle/gradle-dependency-management/

Are they published somewhere else?

Thanks
Si

Here’s the script I ended up writing:

task downloadGradleLibs {
    def gradleLibsDir = file("$buildDir/gradle-libs")

    ext {
        downloadUrl = "https://artifactory3-eu1.moneysupermarket.com/artifactory/gradle/gradle-$gradleLibsVersion-all.zip"
        jarPatterns = [
                "**/gradle-core-${gradleLibsVersion}.jar",
                "**/gradle-core-api-${gradleLibsVersion}.jar",
                "**/gradle-base-services-${gradleLibsVersion}.jar",
                "**/gradle-dependency-management-${gradleLibsVersion}.jar"
        ]
        extractedJars = fileTree(gradleLibsDir) {
            include jarPatterns
            builtBy "downloadGradleLibs"
        }
    }

    inputs.property "downloadUrl", downloadUrl
    inputs.property "jarPatterns", jarPatterns
    outputs.files extractedJars

    doLast {
        gradleLibsDir.mkdirs()

        File downloadFile = file("$temporaryDir/download.zip")
        new URL(downloadUrl).withInputStream { is ->
            downloadFile.withOutputStream { it << is }
        }

        project.copy {
            from zipTree(downloadFile)
            into gradleLibsDir
            include jarPatterns
            includeEmptyDirs false
            eachFile {
                path = name
            }
        }
    }
}

dependencies {
    implementation files(downloadGradleLibs)
}

Same issue here… I’ve built Gradle 6.8.1

gradle publishToMavenLocal -x embeddedIntegTest -x test -x embeddedCrossVersionTest -x docsTest

But it looks like the published artifacts have changed since 6.2 onwards. For example, this artifact is available:

https://repo.gradle.org/gradle/libs-releases-local/org/gradle/gradle-tooling-api/6.8.1/

Actually the JAR files are built here…

gradle/subprojects/distributions/full/build/bin distribution/lib

How do you create all the POM files and put them in a Maven-style repository though?

Cheers,
Nigel

Here’s the commit where the publishing changed in Gradle 6.2:

See publishLocalArchives in subprojects/tooling-api/tooling-api.gradle.kts

I think the quickest way to achieve this Maven-style repository layout is to download the -all.zip

https://services.gradle.org/distributions/gradle-6.8.1-all.zip

… and then run this shell command in the folder lib once you unpack the ZIP file:

for f in gradle-api-metadata gradle-base-annotations gradle-base-services gradle-base-services-groovy gradle-bootstrap gradle-build-cache gradle-build-cache-base gradle-build-cache-packaging gradle-build-events gradle-build-operations gradle-build-option gradle-cli gradle-core gradle-core-api gradle-execution gradle-file-collections gradle-file-watching gradle-files gradle-hashing gradle-installation-beacon gradle-jvm-services gradle-kotlin-dsl gradle-kotlin-dsl-tooling-models gradle-launcher gradle-logging gradle-messaging gradle-model-core gradle-model-groovy gradle-native gradle-normalization-java gradle-persistent-cache gradle-process-services gradle-resources gradle-runtime-api-info gradle-snapshots gradle-tooling-api gradle-worker-processes gradle-wrapper; do mvn install:install-file -Dfile=$f-6.8.1.jar -DgroupId=org.gradle -DartifactId=$f -Dversion=6.8.1 -Dpackaging=jar; done

Hopefully this is correct and can then copy these up to your local Artifactory / JFrog repo or use the local maven repository instead.

I needed this to build a Gradle plugin with Maven build scripts (… legacy CI environment).