From 0f35645e5a1f778474aab1d99a0f14a751e8d24e Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 9 Feb 2024 13:53:39 -0500 Subject: [PATCH] Move `publications 'mavenJava'` to enabled `artifactoryPublish` task --- utils/spring-artifactory-init.gradle | 74 ++++++++++++++-------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/utils/spring-artifactory-init.gradle b/utils/spring-artifactory-init.gradle index 454c6e8..5131c19 100644 --- a/utils/spring-artifactory-init.gradle +++ b/utils/spring-artifactory-init.gradle @@ -22,49 +22,49 @@ allprojects { apply plugin: org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin - afterEvaluate { - pluginManager.withPlugin('maven-publish') { - artifactory { - publish { - contextUrl = System.getenv('ARTIFACTORY_URL') - repository { - repoKey = System.getenv('ARTIFACTORY_REPOSITORY') - username = System.getenv('ARTIFACTORY_USERNAME') - password = System.getenv('ARTIFACTORY_PASSWORD') - } - defaults { - publications 'mavenJava' - def zipArtifactProps = - ['zip.name' : project.name, - 'zip.displayname': project.description, - 'zip.deployed' : 'false'] - properties { - mavenJava zipArtifactProps, '*:*:*:*@zip' - mavenJava 'zip.type': 'docs', '*:*:*:docs@zip' - mavenJava 'zip.type': 'dist', '*:*:*:dist@zip' - } - } - publishForkCount = 10 + artifactory { + publish { + contextUrl = System.getenv('ARTIFACTORY_URL') + repository { + repoKey = System.getenv('ARTIFACTORY_REPOSITORY') + username = System.getenv('ARTIFACTORY_USERNAME') + password = System.getenv('ARTIFACTORY_PASSWORD') + } + defaults { + def zipArtifactProps = + ['zip.name' : project.name, + 'zip.displayname': project.description, + 'zip.deployed' : 'false'] + properties { + mavenJava zipArtifactProps, '*:*:*:*@zip' + mavenJava 'zip.type': 'docs', '*:*:*:docs@zip' + mavenJava 'zip.type': 'dist', '*:*:*:dist@zip' } + } + publishForkCount = 10 + } - buildInfo { - setProject(System.getenv('ARTIFACTORY_BUILD_PROJECT')) - setBuildName(System.getenv('ARTIFACTORY_BUILD_NAME')) - setBuildNumber(System.getenv('ARTIFACTORY_BUILD_NUMBER')) - setBuildUrl(System.getenv('ARTIFACTORY_BUILD_URL')) - setAgentName(System.getenv('ARTIFACTORY_USER_AGENT_NAME')) - setAgentVersion(System.getenv('ARTIFACTORY_USER_AGENT_VERSION')) - setVcsRevision(System.getenv('ARTIFACTORY_VCS_REVISION')) - setVcsUrl(System.getenv('ARTIFACTORY_VCS_URL')) - setArtifactoryPluginVersion('4.33.12') - } + buildInfo { + setProject(System.getenv('ARTIFACTORY_BUILD_PROJECT')) + setBuildName(System.getenv('ARTIFACTORY_BUILD_NAME')) + setBuildNumber(System.getenv('ARTIFACTORY_BUILD_NUMBER')) + setBuildUrl(System.getenv('ARTIFACTORY_BUILD_URL')) + setAgentName(System.getenv('ARTIFACTORY_USER_AGENT_NAME')) + setAgentVersion(System.getenv('ARTIFACTORY_USER_AGENT_VERSION')) + setVcsRevision(System.getenv('ARTIFACTORY_VCS_REVISION')) + setVcsUrl(System.getenv('ARTIFACTORY_VCS_URL')) + setArtifactoryPluginVersion('4.33.12') + } - clientConfig.connectionRetries = 4 - clientConfig.insecureTls = false - } + clientConfig.connectionRetries = 4 + clientConfig.insecureTls = false + } + afterEvaluate { + pluginManager.withPlugin('maven-publish') { tasks.named('artifactoryPublish') { enabled(true) + publications 'mavenJava' } if (!ossrhUrl && gpgPassphrase && gpgPrivateKey) {