Skip to content

Instantly share code, notes, and snippets.

@darylteo
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save darylteo/8891557 to your computer and use it in GitHub Desktop.

Select an option

Save darylteo/8891557 to your computer and use it in GitHub Desktop.
Working with a task created by maven-publish pulication.
apply plugin: 'java'
apply plugin: 'maven-publish'
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
task dummy << {
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar {
classifier "sources"
}
}
}
}
afterEvaluate {
publishMavenJavaPublicationToMavenLocal {
dependsOn(dummy)
doFirst {
println "Does this work?"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment