File tree Expand file tree Collapse file tree 2 files changed +32
-10
lines changed Expand file tree Collapse file tree 2 files changed +32
-10
lines changed Original file line number Diff line number Diff line change 1
1
plugins {
2
- id ' java'
3
2
id ' java-library'
4
3
id ' maven-publish'
4
+ id ' signing'
5
5
id " com.github.ben-manes.versions" version " 0.36.0"
6
6
}
7
7
@@ -18,8 +18,10 @@ javadoc {
18
18
}
19
19
20
20
ext {
21
- bintrayUser = project. hasProperty (' BINTRAY_USER' ) ? BINTRAY_USER : ' n/a'
22
- bintrayKey = project. hasProperty (' BINTRAY_KEY' ) ? BINTRAY_KEY : ' n/a'
21
+ publishUser = project. findProperty (' PUBLISH_USER' ) ?: System . getenv (" PUBLISH_USER" ) ?: ' n/a'
22
+ publishKey = project. findProperty (' PUBLISH_KEY' ) ?: System . getenv (" PUBLISH_KEY" ) ?: ' n/a'
23
+
24
+ isReleaseVersion = ! version. endsWith(" SNAPSHOT" )
23
25
}
24
26
25
27
repositories {
Original file line number Diff line number Diff line change
1
+ // does not work on oss.sonatype.org
2
+ tasks. withType(GenerateModuleMetadata ) {
3
+ enabled = false
4
+ }
5
+
1
6
publishing {
2
7
publications {
3
8
OpenApiProcessor (MavenPublication ) {
@@ -11,8 +16,7 @@ publishing {
11
16
12
17
pom {
13
18
name = project. projectTitle
14
- // description = project.projectDesc
15
- description = " ${ project.projectTitle} - ${ project.projectDesc} - ${ project.name} module" . toString()
19
+ description = project. projectDesc
16
20
url = project. projectUrl
17
21
18
22
licenses {
@@ -40,14 +44,30 @@ publishing {
40
44
41
45
repositories {
42
46
maven {
43
- def releaseRepository = uri(" https://api.bintray.com/maven/openapi-processor/primary/ ${ project.name } /;publish=1;override=0 " )
44
- def snapshotRepository = uri(" https://oss.jfrog .org/oss-snapshot-local/ " )
45
- url = version . endsWith( ' SNAPSHOT ' ) ? snapshotRepository : releaseRepository
47
+ def releaseRepository = uri(" https://oss.sonatype.org/service/local/staging/deploy/maven2 " )
48
+ def snapshotRepository = uri(" https://oss.sonatype .org/content/repositories/snapshots " )
49
+ url = project . isReleaseVersion ? releaseRepository : snapshotRepository
46
50
47
51
credentials {
48
- username = bintrayUser
49
- password = bintrayKey
52
+ username = publishUser
53
+ password = publishKey
50
54
}
51
55
}
56
+
57
+ }
58
+ }
59
+
60
+ tasks. withType(Sign ) {
61
+ onlyIf { project. isReleaseVersion }
62
+ }
63
+
64
+ signing {
65
+ String signingKey = project. findProperty (' SIGN_KEY' ) ?: System . getenv (" SIGN_KEY" ) ?: ' n/a'
66
+ String signingPwd = project. findProperty (' SIGN_PWD' ) ?: System . getenv (" SIGN_PWD" ) ?: ' n/a'
67
+
68
+ useInMemoryPgpKeys(signingKey, signingPwd)
69
+
70
+ signing {
71
+ sign publishing.publications.OpenApiProcessor
52
72
}
53
73
}
You can’t perform that action at this time.
0 commit comments