Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- buildscript.dependencies {
- classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4+"
- }
- apply plugin: 'maven-publish'
- apply plugin: "com.jfrog.artifactory"
- repo = version.endsWith('SNAPSHOT') ? 'mvn-libs-snapshot' : 'mvn-public-local'
- artifactory {
- contextUrl = "${artifactory_contextUrl}"
- publish {
- repository {
- repoKey = repo
- username = artifactoryUser // user and password depending upon repo
- password = artifactoryPassword
- maven = true
- }
- defaults {
- publications ('mavenJava')
- publishBuildInfo = true //Publish build-info to Artifactory (true by default)
- publishArtifacts = true //Publish artifacts to Artifactory (true by default)
- }
- }
- resolve {
- repository {
- repoKey = 'mvn-libs-snapshot'
- username = "${artifactory_user}"
- password = "${artifactory_password}"
- maven = true
- }
- }
- }
- publishing {
- publications {
- mavenJava(MavenPublication) {
- from components.java // publishes default original java sources jar
- artifact shadowJar // fat jar will be uploaded
- artifact distZip // publishes a zip file output this task
- // Multiple tasks can be published
- def allEnvs = deploymentEnvALL.split(',')
- allEnvs.each {
- def env ->
- artifact "zip_$env" { // custom zip tasks containing env specific deployment configs
- classifier = "$env-configs"
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment