jfrog / project-examples

Small projects in universal build ecosystems to configure CI and Artifactory
1.01k stars 2.39k forks source link

kts-publish example: PublishBuildInfo #297

Open alexsapps opened 2 years ago

alexsapps commented 2 years ago

The Groovy example of publishBuildInfo = true from the Gradle Artifactory Plugin docs has no equivalent in the KTS publishing example. So, there are docs for how to do this in Groovy, but not Kotlin. The solution is to use invokeMethod, which took me a long time to find. It would be great if invokeMethod("setPublishBuildInfo", true) could be added to the KTS-publish example along with any other properties that require invokeMethod.

eyalbe4 commented 2 years ago

Thanks a lot for sharing this @alexsapps! In case you're able to contribute this through a pull request to thiis repository, this would be wonderful!

JiangHongTiao commented 6 months ago

Seems like the plugin in version 5.2.0 can call it in PublisherConfig scope:

configure<ArtifactoryPluginConvention> {
    setContextUrl("https://company.jfrog.io/artifactory")
    publish {
        repository {
            repoKey = "maven-snapshot-local"
            username = "user"
            password = "password"
        }
        isPublishBuildInfo = false
        defaults {
            publications("buildPublication")
        }
    }
}