Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 817ee1e

Browse files
committed
Added sourcesJar
1 parent 21f53d7 commit 817ee1e

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

build.gradle

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sourceCompatibility = "1.7"
1010
targetCompatibility = "1.7"
1111

1212
repositories {
13-
mavenCentral()
13+
jcenter()
1414
maven {url "http://developer.marklogic.com/maven2/"}
1515
maven {url "http://rjrudin.github.io/marklogic-java/releases"}
1616
}
@@ -23,29 +23,38 @@ dependencies {
2323
testCompile 'com.marklogic:ml-junit:2.4'
2424
}
2525

26-
javadoc.destinationDir = file(javadocsDir + "/" + project.name)
27-
2826
// This ensures that Gradle includes in the published jar any non-java files under src/main/java
2927
sourceSets.main.resources.srcDir 'src/main/java'
3028

29+
task sourcesJar(type: Jar, dependsOn: classes) {
30+
classifier 'sources'
31+
from sourceSets.main.allJava
32+
}
33+
34+
javadoc.destinationDir = file(javadocsDir + "/" + project.name)
35+
3136
publishing {
3237
publications {
3338
mainJava(MavenPublication) {
3439
from components.java
3540
}
41+
sourcesJava(MavenPublication) {
42+
from components.java
43+
artifact sourcesJar
44+
}
3645
}
3746
repositories {
3847
maven {
3948
url publishUrl
4049
}
4150
}
4251
}
43-
52+
4453
if (project.hasProperty("myBintrayUser")) {
4554
bintray {
4655
user = myBintrayUser
4756
key = myBintrayKey
48-
publications = ['mainJava']
57+
publications = ['mainJava', 'sourcesJava']
4958
pkg {
5059
repo = 'maven'
5160
name = project.name
@@ -56,4 +65,4 @@ if (project.hasProperty("myBintrayUser")) {
5665
}
5766
}
5867
}
59-
}
68+
}

0 commit comments

Comments
 (0)