Skip to content

Commit 487137c

Browse files
committed
#3: Add Signing & Uploading archives support
1 parent 0e8e943 commit 487137c

File tree

3 files changed

+56
-1
lines changed

3 files changed

+56
-1
lines changed

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ configure(allprojects) {
4848

4949
apply(plugin: "java");
5050
apply(plugin: "maven");
51+
apply(plugin: "signing");
5152
apply(plugin: "biz.aQute.bnd.builder");
5253
apply(plugin: "idea");
5354
apply(plugin: "eclipse");
@@ -115,6 +116,9 @@ artifacts {
115116
archives javadocJar;
116117
}
117118

119+
signing {
120+
sign configurations.archives
121+
}
118122

119123
wrapper {
120124
gradleVersion = "5.6.3";

gradle.properties

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
version=3.0.3-SNAPSHOT
1+
version=3.0.3-SNAPSHOT
2+
signing.keyId=YourKeyId
3+
signing.password=YourPublicKeyPassword
4+
signing.secretKeyRingFile=PathToYourKeyRingFile
5+
6+
ossrhUsername=your-jira-id
7+
ossrhPassword=your-jira-password

project.gradle

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,48 @@ javadoc.options {
6060
links("https://java-json-tools.github.io/msg-simple/");
6161
links("https://java-json-tools.github.io/jackson-coreutils/");
6262
}
63+
64+
uploadArchives {
65+
repositories {
66+
mavenDeployer {
67+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
68+
69+
repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
70+
authentication(userName: ossrhUsername, password: ossrhPassword)
71+
}
72+
73+
snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
74+
authentication(userName: ossrhUsername, password: ossrhPassword)
75+
}
76+
77+
pom.project {
78+
name 'json-patch-query'
79+
packaging 'jar'
80+
// optionally artifactId can be defined here
81+
description 'JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7386) implementation in Java, using extended TMF620 JsonPath syntax'
82+
url 'https://github.com/gravity9-tech/json-patch'
83+
84+
scm {
85+
connection 'scm:git:https://github.com/java-json-tools/json-patch.git'
86+
developerConnection 'scm:git:ssh://github.com:java-json-tools/json-patch.git'
87+
url 'https://github.com/gravity9-tech/json-patch'
88+
}
89+
90+
licenses {
91+
license {
92+
name 'The Apache License, Version 2.0'
93+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
94+
}
95+
}
96+
97+
developers {
98+
developer {
99+
id 'manfred'
100+
name 'Manfred Moser'
101+
email 'manfred@sonatype.com'
102+
}
103+
}
104+
}
105+
}
106+
}
107+
}

0 commit comments

Comments
 (0)