Skip to content

Instantly share code, notes, and snippets.

@d10xa
Created August 4, 2015 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d10xa/bc640140881638b2f9b2 to your computer and use it in GitHub Desktop.
Save d10xa/bc640140881638b2f9b2 to your computer and use it in GitHub Desktop.
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