jfrog / artifactory-gradle-plugin

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

How can I define two repo keys for snapshot and release? #97

Closed aidin-gh closed 5 months ago

aidin-gh commented 6 months ago

How can we help?

Hi,

We have two repo URLs for snapshots and releases:

http://artifactory.movio.co/artifactory/libs-release-local
http://artifactory.movio.co/artifactory/libs-snapshot-local

I tried searching through the examples, and even the code, but couldn't figure out how I should configure it.

Seems that the logic is implemented here: https://github.com/jfrog/artifactory-gradle-plugin/blob/main/src/main/java/org/jfrog/gradle/plugin/artifactory/utils/PublicationUtils.java#L177

I thought the following would work, but it doesn't recognize releaseRepoKey and snapshotRepoKey.

plugins {
    id "com.jfrog.artifactory" version "5.+"
}

artifactory {
  publish {
    // Define the Artifactory URL for publishing artifacts
    contextUrl = 'http://artifactory.movio.co/artifactory'
    // Define the project repository to which the artifacts will be published
    repository {
        // Set the Artifactory repository key
        releaseRepoKey = 'libs-release-local'
        snapshotRepoKey = 'libs-snapshot-local'
    }

    // Include all configured publications for all the modules
    defaults {
        publications('ALL_PUBLICATIONS')
    }
  }
}

The error is:

Could not set unknown property 'releaseRepoKey' for object of type org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig$Repository

I'm using Gradle 8.5.

Thanks!

yahavi commented 5 months ago

@aidin-gh Thank you for using the Gradle Artifactory plugin. We added this feature in the latest release v5.2.0. Feel free to upgrade - we'd appreciate your feedback on that!