Skip to content

Commit 201b22b

Browse files
authored
Merge pull request #33 from linked-planet/feature/upgrade-jira-confluence
Upgrading Jira to 9.12.10, SM to 5.12.10, Confluence to 9.2.3, Java t…
2 parents 133ad56 + 4762409 commit 201b22b

File tree

19 files changed

+658
-75
lines changed

19 files changed

+658
-75
lines changed

.github/workflows/default.yml

Lines changed: 78 additions & 49 deletions
Large diffs are not rendered by default.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
wrapperVersion=3.3.2
18+
distributionType=only-script
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# kotlin-atlassian-client
22
![Maven Central](https://img.shields.io/maven-central/v/com.linked-planet.client/kotlin-jira-client-api)
33
[![kotlin-atlassian-client - default](https://github.com/linked-planet/kotlin-atlassian-client/actions/workflows/default.yml/badge.svg)](https://github.com/linked-planet/kotlin-atlassian-client/actions/workflows/default.yml)
4-
![Kotlin 1.8.0](https://img.shields.io/badge/Kotlin-1.8.0-blue)
5-
![Jira 9.4.2](https://img.shields.io/badge/Jira-9.4.2-blue)
6-
![Confluence 7.19.5](https://img.shields.io/badge/Confluence-7.19.5-lightblue)
4+
![Kotlin 2.1.20](https://img.shields.io/badge/Kotlin-2.1.20-blue)
5+
![Jira 9.12.10](https://img.shields.io/badge/Jira-9.12.10-blue)
6+
![Confluence 9.2.3](https://img.shields.io/badge/Confluence-9.2.3-lightblue)
77
> *kotlin-atlassian-client* merges the libraries of the repositories *kotlin-http-client*, *kotlin-jira-client* and *kotlin-insight-client* originally implemented by @betacore.
88
99
## Docs

kotlin-insight-client/kotlin-insight-client-api/src/main/kotlin/com/linkedplanet/kotlininsightclient/api/impl/GsonUtil.kt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,42 @@ import com.google.gson.stream.JsonReader
2525
import com.google.gson.stream.JsonWriter
2626
import com.linkedplanet.kotlininsightclient.api.model.InsightAttribute
2727
import com.linkedplanet.kotlininsightclient.api.model.ObjectTypeSchemaAttribute
28+
import java.time.LocalDate
29+
import java.time.LocalTime
2830
import java.time.ZonedDateTime
2931

3032

3133
class GsonUtil {
3234
companion object {
3335
fun gsonBuilder(): GsonBuilder = GsonBuilder()
36+
.registerTypeAdapter(LocalDate::class.java, localDateAdapter)
37+
.registerTypeAdapter(LocalTime::class.java, localTimeAdapter)
3438
.registerTypeAdapter(ZonedDateTime::class.java, zonedDateTimeAdapter)
3539
.registerTypeAdapterFactory(SealedTypeAdapterFactory.of(InsightAttribute::class))
3640
.registerTypeAdapterFactory(SealedTypeAdapterFactory.of(ObjectTypeSchemaAttribute::class,
3741
typeFieldName = "type",
3842
jsonNameForType = { it.simpleName!!.removeSuffix("Schema") to it }
3943
))
4044

45+
private val localDateAdapter = object : TypeAdapter<LocalDate>() {
46+
override fun write(out: JsonWriter, value: LocalDate?) {
47+
out.value(value.toString())
48+
}
49+
50+
override fun read(`in`: JsonReader): LocalDate {
51+
return LocalDate.parse(`in`.nextString())
52+
}
53+
}
54+
55+
private val localTimeAdapter = object : TypeAdapter<LocalTime>() {
56+
override fun write(out: JsonWriter, value: LocalTime?) {
57+
out.value(value.toString())
58+
}
59+
60+
override fun read(`in`: JsonReader): LocalTime {
61+
return LocalTime.parse(`in`.nextString())
62+
}
63+
}
4164

4265
private val zonedDateTimeAdapter = object : TypeAdapter<ZonedDateTime>() {
4366
override fun write(out: JsonWriter, value: ZonedDateTime?) {

kotlin-insight-client/kotlin-insight-client-sdk/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@
5353
<artifactId>insight</artifactId>
5454
<scope>provided</scope>
5555
<exclusions>
56+
<exclusion>
57+
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
58+
<artifactId>http-builder</artifactId>
59+
</exclusion>
60+
<exclusion>
61+
<groupId>javax.xml.bind</groupId>
62+
<artifactId>jaxb-api</artifactId>
63+
</exclusion>
5664
<exclusion>
5765
<groupId>org.ehcache</groupId>
5866
<artifactId>ehcache</artifactId>

kotlin-insight-client/kotlin-insight-client-test-sdk/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@
7878
<artifactId>insight</artifactId>
7979
<scope>provided</scope>
8080
<exclusions>
81+
<exclusion>
82+
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
83+
<artifactId>http-builder</artifactId>
84+
</exclusion>
85+
<exclusion>
86+
<groupId>javax.xml.bind</groupId>
87+
<artifactId>jaxb-api</artifactId>
88+
</exclusion>
8189
<exclusion>
8290
<groupId>org.ehcache</groupId>
8391
<artifactId>ehcache</artifactId>

kotlin-insight-client/pom.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,28 @@
4848
<groupId>com.atlassian.jira.plugins</groupId>
4949
<artifactId>insight</artifactId>
5050
<version>${insight.version}</version>
51+
<exclusions>
52+
<exclusion>
53+
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
54+
<artifactId>http-builder</artifactId>
55+
</exclusion>
56+
<exclusion>
57+
<groupId>javax.xml.bind</groupId>
58+
<artifactId>jaxb-api</artifactId>
59+
</exclusion>
60+
<exclusion>
61+
<groupId>org.ehcache</groupId>
62+
<artifactId>ehcache</artifactId>
63+
</exclusion>
64+
<exclusion>
65+
<groupId>com.atlassian.translations</groupId>
66+
<artifactId>*</artifactId>
67+
</exclusion>
68+
<exclusion>
69+
<groupId>com.atlassian.jira.plugins</groupId>
70+
<artifactId>insight-core-widget-report</artifactId>
71+
</exclusion>
72+
</exclusions>
5173
</dependency>
5274

5375
<!-- Kotlin -->

kotlin-jira-client/kotlin-jira-client-api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<dependency>
1818
<groupId>com.google.code.gson</groupId>
1919
<artifactId>gson</artifactId>
20-
<version>2.10.1</version>
20+
<version>2.2.2-atlassian-1</version>
2121
</dependency>
2222
<dependency>
2323
<groupId>com.linked-planet.client</groupId>

kotlin-jira-client/kotlin-jira-client-http/src/main/kotlin/com/linkedplanet/kotlinjiraclient/http/HttpJiraIssueOperator.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,13 @@ class HttpJiraIssueOperator(private val context: HttpJiraClientContext) : JiraIs
249249
}
250250

251251
private fun extractEmbeddedMappings(issuePage: HttpJiraIssuePage): Map<String, String> {
252-
val names = issuePage.names.asJsonObject
252+
val names = issuePage.names?.asJsonObject
253253
return names
254-
.entrySet()
255-
.map { it.key }
256-
.associateBy {
254+
?.entrySet()
255+
?.map { it.key }
256+
?.associateBy {
257257
names.get(it).asString
258-
}
258+
}?: emptyMap()
259259
}
260260

261261
private fun extractEmbeddedMappings(jsonObject: JsonObject): Map<String, String> {
@@ -310,12 +310,12 @@ class HttpJiraIssueOperator(private val context: HttpJiraClientContext) : JiraIs
310310
private val maxResults: Number,
311311
private val startAt: Number,
312312
private val total: Number,
313-
private val issues: List<JsonElement>,
314-
val names: JsonElement
313+
private val issues: Array<JsonElement>,
314+
val names: JsonElement? = null
315315
) : HttpPage<JsonElement> {
316316
override fun getMaxResults() = maxResults
317317
override fun getStartAt() = startAt
318318
override fun getTotal() = total
319-
override fun getValues(): List<JsonElement> = issues
319+
override fun getValues(): List<JsonElement> = issues.asList()
320320
}
321321
}

kotlin-jira-client/kotlin-jira-client-sdk/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@
7979
<artifactId>insight</artifactId>
8080
<scope>provided</scope>
8181
<exclusions>
82+
<exclusion>
83+
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
84+
<artifactId>http-builder</artifactId>
85+
</exclusion>
86+
<exclusion>
87+
<groupId>javax.xml.bind</groupId>
88+
<artifactId>jaxb-api</artifactId>
89+
</exclusion>
8290
<exclusion>
8391
<groupId>org.ehcache</groupId>
8492
<artifactId>ehcache</artifactId>

0 commit comments

Comments
 (0)