Created
August 4, 2015 11:53
-
-
Save d10xa/bc640140881638b2f9b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
maven { | |
def artifactoryUrl = this.hasProperty('artifactory_url') ? artifactory_url : 'http://localhost:8081/artifactory' | |
url "${artifactoryUrl}/plugins-release" | |
credentials { | |
username = this.hasProperty('artifactory_username') ? artifactory_username : 'admin' | |
password = this.hasProperty('artifactory_password') ? artifactory_password : 'password' | |
} | |
name = "maven-main-cache" | |
} | |
} | |
} | |
plugins { | |
id 'com.jfrog.artifactory' version '3.1.0' | |
} | |
apply from: 'build.gradle' | |
apply plugin: 'maven' | |
apply plugin: 'maven-publish' | |
artifactory { | |
contextUrl = this.hasProperty('artifactory_url') ? artifactory_url : 'http://localhost:8081/artifactory' | |
publish { | |
contextUrl = this.hasProperty('artifactory_url') ? artifactory_url : 'http://localhost:8081/artifactory' | |
repository { | |
repoKey = version.endsWith('SNAPSHOT') ? 'libs-snapshot-local' : 'libs-release-local' | |
username = this.hasProperty('artifactory_username') ? artifactory_username : 'admin' | |
password = this.hasProperty('artifactory_password') ? artifactory_password : 'password' | |
maven = true | |
} | |
defaults { | |
publications('mavenGroovy') | |
properties { | |
mavenGroovy 'ru.vetrf:*:*:*@*', key1: 'val1' | |
} | |
} | |
} | |
} | |
task sourceJar(type: Jar) { | |
from sourceSets.main.allJava | |
} | |
publishing { | |
publications { | |
mavenGroovy(MavenPublication) { | |
from components.java | |
artifact sourceJar { | |
classifier "sources" | |
} | |
} | |
} | |
} | |
build.dependsOn 'generatePomFileForMavenGroovyPublication' | |
// gradle -b artifactory.gradle clean build artifactoryPublish |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment