Skip to content

Commit f782eeb

Browse files
committed
change gradle.build for correct publish
1 parent f2f3004 commit f782eeb

File tree

1 file changed

+10
-47
lines changed

1 file changed

+10
-47
lines changed

build.gradle

Lines changed: 10 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ plugins {
44
id 'signing'
55
}
66

7+
java {
8+
sourceCompatibility = JavaVersion.VERSION_1_8
9+
targetCompatibility = JavaVersion.VERSION_1_8
10+
withJavadocJar()
11+
withSourcesJar()
12+
}
13+
714
group 'io.github.eaxdev'
815
archivesBaseName = 'jsonresume-validator'
916
version '0.0.1'
@@ -31,24 +38,13 @@ test {
3138
useJUnitPlatform()
3239
}
3340

34-
task sourceJar(type: Jar) {
35-
classifier "sources"
41+
jar {
42+
from sourceSets.main.output
3643
from sourceSets.main.allJava
3744
}
3845

39-
task javadocJar(type: Jar, dependsOn: javadoc) {
40-
classifier "javadoc"
41-
from javadoc.destinationDir
42-
}
43-
44-
artifacts {
45-
archives jar
46-
archives sourceJar
47-
archives javadocJar
48-
}
49-
5046
signing {
51-
sign configurations.archives
47+
sign publishing.publications
5248
}
5349

5450
publishing {
@@ -60,35 +56,6 @@ publishing {
6056
version version
6157

6258
from components.java
63-
64-
pom.withXml {
65-
def pomFile = file("${project.buildDir}/generated-pom.xml")
66-
writeTo(pomFile)
67-
def pomAscFile = signing.sign(pomFile).signatureFiles[0]
68-
artifact(pomAscFile) {
69-
classifier = null
70-
extension = 'pom.asc'
71-
}
72-
}
73-
74-
artifact(sourceJar) {
75-
classifier = 'sources'
76-
}
77-
artifact(javadocJar) {
78-
classifier = 'javadoc'
79-
}
80-
81-
project.tasks.signArchives.signatureFiles.each {
82-
artifact(it) {
83-
def matcher = it.file =~ /-(sources|javadoc)\.jar\.asc$/
84-
if (matcher.find()) {
85-
classifier = matcher.group(1)
86-
} else {
87-
classifier = null
88-
}
89-
extension = 'jar.asc'
90-
}
91-
}
9259
}
9360
}
9461
repositories {
@@ -107,10 +74,6 @@ model {
10774
destination = file("$buildDir/generated-pom.xml")
10875
}
10976
tasks.publishMavenJavaPublicationToMavenLocal {
110-
dependsOn project.tasks.signArchives
111-
}
112-
tasks.publishMavenJavaPublicationToMavenRepository {
113-
dependsOn project.tasks.signArchives
11477
}
11578
}
11679

0 commit comments

Comments
 (0)