Skip to content

Commit 178a92a

Browse files
Publish to sonatype
1 parent de98f45 commit 178a92a

4 files changed

Lines changed: 84 additions & 13 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The artifact is available through Maven Central via Sonatype.
2525
### Gradle
2626

2727
```
28-
compile 'dev.nicklasw:bankid-sdk:0.10.0'
28+
implementation 'dev.nicklasw:bankid-sdk:0.10.0'
2929
```
3030

3131
## Changelog

build.gradle

Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ plugins {
66
id "net.ltgt.errorprone" version "2.0.2"
77
id 'checkstyle'
88
id 'maven-publish'
9+
id 'signing'
10+
id 'jacoco'
911
}
1012

1113
group 'dev.nicklasw'
1214
version '0.10.0-SNAPSHOT'
1315

14-
sourceCompatibility=16
15-
targetCompatibility=16
16+
sourceCompatibility = 16
17+
targetCompatibility = 16
1618

1719
repositories {
1820
mavenCentral()
@@ -72,23 +74,93 @@ tasks.withType(JavaCompile) {
7274
}
7375
}
7476

75-
publishing {
77+
task javadocJar(type: Jar) {
78+
from javadoc.destinationDir
79+
classifier = 'javadoc'
80+
}
81+
82+
task sourcesJar(type: Jar) {
83+
from sourceSets.main.delombokTask
84+
classifier = 'sources'
85+
}
86+
7687

88+
publishing {
7789
repositories {
7890
maven {
79-
name = "GitHubPackages"
80-
url = "https://maven.pkg.github.com/NicklasWallgren/bankid-sdk"
91+
name = "ossrh"
92+
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
8193
credentials {
82-
username = "NicklasWallgren"
83-
password = "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"
94+
username = findProperty('ossrhUsername')
95+
password = findProperty('ossrhPassword')
8496
}
8597
}
98+
// maven {
99+
// name = "ossrhSnapshot"
100+
// url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
101+
// credentials {
102+
// username = findProperty('ossrhUsername')
103+
// password = findProperty('ossrhPassword')
104+
// }
105+
// }
86106
}
87-
88107
publications {
89108
mavenJava(MavenPublication) {
90109
from components.java
110+
artifact sourcesJar
111+
artifact javadocJar
112+
113+
pom {
114+
name = 'BankID SDK'
115+
artifactId = 'bankid-sdk'
116+
packaging = 'jar'
117+
description = 'A SDK to interact with the BankID API'
118+
url = 'https://github.com/NicklasWallgren/bankid-java-sdk'
119+
120+
scm {
121+
connection = 'scm:git:git://github.com/NicklasWallgren/bankid-java-sdk.git'
122+
developerConnection = 'scm:git:ssh://github.com/NicklasWallgren/bankid-java-sdk.git'
123+
url = 'https://github.com/NicklasWallgren/bankid-java-sdk'
124+
}
125+
126+
licenses {
127+
license {
128+
name = 'MIT Licence'
129+
url = 'https://github.com/NicklasWallgren/bankid-java-sdk/blob/master/LICENSE'
130+
}
131+
}
132+
133+
developers {
134+
developer {
135+
id = 'nicklas'
136+
name = 'NicklasWallgren'
137+
email = 'nicklas.wallgren@stim.se'
138+
}
139+
}
140+
}
91141
}
92142
}
143+
}
93144

94-
}
145+
javadoc {
146+
exclude "**/lombok.config"
147+
dependsOn delombok
148+
failOnError = false
149+
}
150+
151+
delombok {
152+
modulePath.from sourceSets.main.compileClasspath
153+
}
154+
155+
jacocoTestReport {
156+
reports {
157+
xml.enabled true
158+
html.enabled true
159+
}
160+
}
161+
162+
check.dependsOn jacocoTestReport
163+
164+
signing {
165+
sign publishing.publications.mavenJava
166+
}

src/main/java/dev/nicklasw/bankid/BankId.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ public CompletableFuture<SignResponse> signAsync(@NonNull final SignRequest requ
8686
return client.sendRequestAsync(request, SignResponse.class);
8787
}
8888

89-
9089
/**
9190
* Collects the result of a sign or auth order suing the orderRef as reference.
9291
* <p>
@@ -114,7 +113,6 @@ public CompletableFuture<CollectResponse> collectAsync(@NonNull final CollectReq
114113
return client.sendRequestAsync(request, CollectResponse.class);
115114
}
116115

117-
118116
/**
119117
* Cancels an ongoing sign or auth order.
120118
* <p>

src/main/java/module-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
module dev.nicklasw.bankid {
22
requires static lombok;
3+
requires static com.github.spotbugs.annotations;
34
requires java.net.http;
45
requires com.fasterxml.jackson.annotation;
56
requires com.fasterxml.jackson.core;
67
requires com.fasterxml.jackson.databind;
7-
requires static com.github.spotbugs.annotations;
8+
exports dev.nicklasw.bankid;
89
exports dev.nicklasw.bankid.configuration;
910
exports dev.nicklasw.bankid.client;
1011
exports dev.nicklasw.bankid.exceptions;

0 commit comments

Comments
 (0)