view artifactory70-github.gradle @ 357:ab7103f0c154

try some more maven publishing items
author Marc Davis <marc.davis@mcoecn.org>
date Tue, 05 Sep 2023 15:40:13 -0400
parents
children 3a33f23a26db
line wrap: on
line source

logger.info("applying SSDT bamboo/artifactory Gradle Settings")

buildscript {
    repositories {
//        maven { url 'https://docker.ssdt.io/artifactory/gradle-plugins' }
        mavenCentral()
    }
    dependencies {
        classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.28.4"
    }
}

//apply plugin: org.jfrog.gradle.plugin.artifactory.ArtifactoryConfigurationsPlugin

allprojects {
    apply plugin: org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin
    apply plugin: 'ivy-publish'
    apply plugin: 'maven-publish'
    apply plugin: 'java'

    afterEvaluate {
        publishing {
            publications {
                ivyJava(IvyPublication) {
                    from components.java
                }
                mavenJava(MavenPublication) {
                    from components.java
                }
            }
        }
    }
}

artifactory {
    contextUrl = 'https://docker.ssdt.io/artifactory'
    publish {
        def isFeature = gradle.branchStream == 'feature'
        repository {
            repoKey = isFeature ? 'libs-branches-local' : 'libs-snapshots-local'
            if (gradle.branch.isRelease()) {
                repoKey = "libs-releases-local/${project.gradle.branchHash}"
            }
            // Publisher username and password
            // Sub projects must provide these values via command line or properties file
            username = artifactoryUsername
            password = artifactoryPassword
            if (isFeature) {
                ivy {
                    ivyLayout = "[organization]/[module]/ivy-[revision].xml"
                    artifactLayout = "[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]"
                    mavenCompatible = true
                }
            }
        }
        defaults {
            publications('ivyJava', 'mavenJava')
            publishBuildInfo = true
            publishArtifacts = true
            publishPom = true
            publishIvy = true
            properties = [ 'ssdt-branch.branchName': gradle.branchName.replaceAll('/','-'), 'ssdt-branch.branchStream': gradle.branchStream ]
        }
    }
}