@@ -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
1113group ' dev.nicklasw'
1214version ' 0.10.0-SNAPSHOT'
1315
14- sourceCompatibility= 16
15- targetCompatibility= 16
16+ sourceCompatibility = 16
17+ targetCompatibility = 16
1618
1719repositories {
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+ }
0 commit comments