fix publish configuration
publish is now possible with the tasks publishToMavenLocal and publishMavenJavaPublicationToMyRepoRepository
This commit is contained in:
34
build.gradle
34
build.gradle
@@ -45,28 +45,34 @@ subprojects {
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
uploadArchives {
|
||||
repositories {
|
||||
mavenDeployer {
|
||||
if (!project.hasProperty('mavenDeployRepo')){
|
||||
throw new IllegalStateException("Set the property 'mavenDeployRepo' to the repository URL. A good place is ~/.gradle/gradle.properties")
|
||||
|
||||
/**
|
||||
* Publish the to a local repository.
|
||||
* Use 'gradlew publishToMavenLocal' to publish to the local maven repo.
|
||||
* If the property 'mavenDeployRepo' is set in gradle.properties, then you can use
|
||||
* 'gradlew publishMavenJavaPublicationToMyRepoRepository' to publish to that repository.
|
||||
*/
|
||||
publishing {
|
||||
if (project.hasProperty('mavenDeployRepo')){
|
||||
repositories {
|
||||
maven {
|
||||
name = "MyRepo" // optional target repository name
|
||||
url = "${mavenDeployRepo}"
|
||||
}
|
||||
repository(url: "${mavenDeployRepo}")
|
||||
println "publishing to: ${mavenDeployRepo}"
|
||||
}
|
||||
}
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
from components.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier 'sources'
|
||||
from sourceSets.main.allSource
|
||||
java {
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
}
|
||||
|
||||
// dependencies that all sub-projects have
|
||||
dependencies {
|
||||
|
||||
Reference in New Issue
Block a user