-
Notifications
You must be signed in to change notification settings - Fork 2
/
publish.gradle
95 lines (84 loc) · 2.86 KB
/
publish.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
tasks.bootJar { enabled = true }
tasks.jar { enabled = false }
project.ext.appId = "petstore"
//task javadocJar(type: Jar) {
// archiveClassifier.set('javadoc')
// from javadoc
// preserveFileTimestamps = false
// reproducibleFileOrder = true
//}
//
//task sourcesJar(type: Jar) {
// archiveClassifier.set('sources')
// from sourceSets.main.allSource
// preserveFileTimestamps = false
// reproducibleFileOrder = true
//}
java {
withSourcesJar()
withJavadocJar()
}
//configurations {
// [apiElements, runtimeElements].each {
// it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) }
// it.outgoing.artifact(bootJar)
// }
//}
publishing {
publications {
bootJava(MavenPublication) {
//publication(MavenPublication) {
//from components.java
//groupId = 'com.net128.oss.web.app.vaadin'
artifact bootJar
//from components.java
//artifact tasks.named("bootJar")
artifact sourcesJar
artifact javadocJar
pom {
name = appId
artifactId = appId
packaging = 'jar'
description = '''\
Vaadin Petstore Application
'''
url = 'https://github.com/mike-seger/web-modules/'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'ms'
name = 'Michael Seger'
email = '[email protected]<'
}
}
scm {
connection = 'scm:git:[email protected]:mike-seger/vaadin-petstore.git'
developerConnection = 'scm:git:[email protected]:mike-seger/vaadin-petstore.git'
url = 'https://github.com/mike-seger/vaadin-petstore'
}
}
}
}
repositories {
maven {
name = version.endsWith('SNAPSHOT') ? "ossrh" : "ossrhSnapshot"
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
}
signing {
//sign publishing.publications.release
sign publishing.publications.bootJava
}
// https://medium.com/@nmauti/sign-and-publish-on-maven-central-a-project-with-the-new-maven-publish-gradle-plugin-22a72a4bfd4b