From 0d29b787f665990dff7751a42d43abdd0dd6e395 Mon Sep 17 00:00:00 2001 From: arolfes Date: Wed, 8 Nov 2023 14:15:30 +0100 Subject: [PATCH] Closes #612: Switch from SB2.7.X to SB3.1.X and from javax to jakarta --- camunda-outbox-example-boot/pom.xml | 2 +- pom.xml | 21 ++++++++------- .../pom.xml | 19 +++++-------- .../pom.xml | 6 ----- taskana-adapter-camunda-outbox-rest/pom.xml | 7 +++-- .../rest/config/OutboxRestServiceConfig.java | 4 +-- .../CamundaTaskEventsController.java | 27 ++++++++++--------- .../camunda/outbox/rest/controller/PATCH.java | 13 --------- ...mundaTaskEventNotFoundExceptionMapper.java | 6 ++--- .../InvalidArgumentExceptionMapper.java | 6 ++--- .../exception/JsonParseExceptionMapper.java | 6 ++--- .../MismatchedInputExceptionMapper.java | 6 ++--- .../service/CamundaTaskEventsService.java | 2 +- .../pom.xml | 18 +++++++++---- .../src/main/resources/application.properties | 7 +++++ .../main/resources/application.properties.h2 | 4 +++ .../resources/application.properties.postgres | 4 +++ .../integration/AbsIntegrationTest.java | 2 +- .../pom.xml | 7 ++--- taskana-adapter/pom.xml | 5 ++++ .../systemconnector/api/SystemResponse.java | 13 +++++++-- 21 files changed, 101 insertions(+), 84 deletions(-) delete mode 100644 taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/controller/PATCH.java diff --git a/camunda-outbox-example-boot/pom.xml b/camunda-outbox-example-boot/pom.xml index 144243b3..d7697650 100644 --- a/camunda-outbox-example-boot/pom.xml +++ b/camunda-outbox-example-boot/pom.xml @@ -69,7 +69,7 @@ org.jboss.resteasy - resteasy-spring-boot-starter + resteasy-servlet-spring-boot-starter ${version.resteasy.spring.boot} diff --git a/pom.xml b/pom.xml index 403c720b..4b1b0226 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ UTF-8 UTF-8 - 7.0.1-SNAPSHOT + 8.0.0 10.12.4 @@ -59,16 +59,19 @@ 3.10.0.2594 3.5.13 - 2.2.2 + 3.0.2 - 5.3.26.RELEASE - 3.0.0 - 2.7.10 + 3.0.0 + 3.1.5 - 7.17.0 - 1.2 - 1.19.1 - 5.0.0.Final + 7.20.0 + 1.22.0 + + 2.1.1 + 6.0.0 + 3.1.0 + + 6.0.4.Final 3.0.12.Final 2.1.1 5.3.1 diff --git a/taskana-adapter-camunda-listener-example/pom.xml b/taskana-adapter-camunda-listener-example/pom.xml index ddc62d55..9cd7ad6e 100644 --- a/taskana-adapter-camunda-listener-example/pom.xml +++ b/taskana-adapter-camunda-listener-example/pom.xml @@ -33,9 +33,9 @@ - javax.ws.rs - javax.ws.rs-api - ${version.javax.ws.rs.api} + jakarta.ws.rs + jakarta.ws.rs-api + ${version.jakarta-ws-rs-api} @@ -54,13 +54,6 @@ org.camunda.bpm camunda-engine-cdi - - - org.camunda.bpm.extension - camunda-bpm-assert - ${version.camunda.bpm.extensions} - test - org.camunda.spin @@ -76,12 +69,14 @@ org.camunda.template-engines camunda-template-engines-freemarker - provided + 2.2.0 + test org.camunda.template-engines camunda-template-engines-velocity - provided + 2.1.0 + test diff --git a/taskana-adapter-camunda-outbox-rest-spring-boot-starter/pom.xml b/taskana-adapter-camunda-outbox-rest-spring-boot-starter/pom.xml index 0c08b4d4..153f048e 100644 --- a/taskana-adapter-camunda-outbox-rest-spring-boot-starter/pom.xml +++ b/taskana-adapter-camunda-outbox-rest-spring-boot-starter/pom.xml @@ -40,12 +40,6 @@ postgresql test - - org.jboss.resteasy - jaxrs-api - ${version.resteasy.jaxrs} - provided - diff --git a/taskana-adapter-camunda-outbox-rest/pom.xml b/taskana-adapter-camunda-outbox-rest/pom.xml index e329e465..61e00b60 100644 --- a/taskana-adapter-camunda-outbox-rest/pom.xml +++ b/taskana-adapter-camunda-outbox-rest/pom.xml @@ -39,10 +39,9 @@ ${version.camunda.spin} - org.jboss.resteasy - jaxrs-api - ${version.resteasy.jaxrs} - provided + jakarta.ws.rs + jakarta.ws.rs-api + ${version.jakarta-ws-rs-api} org.mybatis diff --git a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/config/OutboxRestServiceConfig.java b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/config/OutboxRestServiceConfig.java index 7edb831f..6d1ad740 100644 --- a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/config/OutboxRestServiceConfig.java +++ b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/config/OutboxRestServiceConfig.java @@ -1,9 +1,9 @@ package pro.taskana.adapter.camunda.outbox.rest.config; +import jakarta.ws.rs.ApplicationPath; +import jakarta.ws.rs.core.Application; import java.util.HashSet; import java.util.Set; -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; import pro.taskana.adapter.camunda.outbox.rest.controller.CamundaTaskEventsController; import pro.taskana.adapter.camunda.outbox.rest.exception.CamundaTaskEventNotFoundExceptionMapper; import pro.taskana.adapter.camunda.outbox.rest.exception.InvalidArgumentExceptionMapper; diff --git a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/controller/CamundaTaskEventsController.java b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/controller/CamundaTaskEventsController.java index 0fcced58..e27286f7 100644 --- a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/controller/CamundaTaskEventsController.java +++ b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/controller/CamundaTaskEventsController.java @@ -1,20 +1,21 @@ package pro.taskana.adapter.camunda.outbox.rest.controller; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.PATCH; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.UriInfo; import java.util.List; import java.util.Map; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; import pro.taskana.adapter.camunda.outbox.rest.exception.CamundaTaskEventNotFoundException; import pro.taskana.adapter.camunda.outbox.rest.exception.InvalidArgumentException; import pro.taskana.adapter.camunda.outbox.rest.model.CamundaTaskEvent; diff --git a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/controller/PATCH.java b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/controller/PATCH.java deleted file mode 100644 index 74805e75..00000000 --- a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/controller/PATCH.java +++ /dev/null @@ -1,13 +0,0 @@ -package pro.taskana.adapter.camunda.outbox.rest.controller; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import javax.ws.rs.HttpMethod; - -@Target({ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@HttpMethod("PATCH") -@SuppressWarnings("checkstyle:AbbreviationAsWordInName") -public @interface PATCH {} diff --git a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/CamundaTaskEventNotFoundExceptionMapper.java b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/CamundaTaskEventNotFoundExceptionMapper.java index 9f44b00b..2d4903d4 100644 --- a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/CamundaTaskEventNotFoundExceptionMapper.java +++ b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/CamundaTaskEventNotFoundExceptionMapper.java @@ -1,8 +1,8 @@ package pro.taskana.adapter.camunda.outbox.rest.exception; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import jakarta.ws.rs.ext.ExceptionMapper; public class CamundaTaskEventNotFoundExceptionMapper implements ExceptionMapper { diff --git a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/InvalidArgumentExceptionMapper.java b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/InvalidArgumentExceptionMapper.java index 0887deaa..ff557807 100644 --- a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/InvalidArgumentExceptionMapper.java +++ b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/InvalidArgumentExceptionMapper.java @@ -1,8 +1,8 @@ package pro.taskana.adapter.camunda.outbox.rest.exception; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import jakarta.ws.rs.ext.ExceptionMapper; public class InvalidArgumentExceptionMapper implements ExceptionMapper { diff --git a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/JsonParseExceptionMapper.java b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/JsonParseExceptionMapper.java index 1bee2379..3fa48e7e 100644 --- a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/JsonParseExceptionMapper.java +++ b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/JsonParseExceptionMapper.java @@ -1,8 +1,8 @@ package pro.taskana.adapter.camunda.outbox.rest.exception; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import jakarta.ws.rs.ext.ExceptionMapper; import spinjar.com.fasterxml.jackson.core.JsonParseException; public class JsonParseExceptionMapper implements ExceptionMapper { diff --git a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/MismatchedInputExceptionMapper.java b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/MismatchedInputExceptionMapper.java index 0141ccc5..30e0e099 100644 --- a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/MismatchedInputExceptionMapper.java +++ b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/exception/MismatchedInputExceptionMapper.java @@ -1,8 +1,8 @@ package pro.taskana.adapter.camunda.outbox.rest.exception; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import jakarta.ws.rs.ext.ExceptionMapper; import spinjar.com.fasterxml.jackson.databind.exc.MismatchedInputException; public class MismatchedInputExceptionMapper implements ExceptionMapper { diff --git a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/service/CamundaTaskEventsService.java b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/service/CamundaTaskEventsService.java index 9fceca73..21bb76d8 100644 --- a/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/service/CamundaTaskEventsService.java +++ b/taskana-adapter-camunda-outbox-rest/src/main/java/pro/taskana/adapter/camunda/outbox/rest/service/CamundaTaskEventsService.java @@ -2,6 +2,7 @@ import static java.util.stream.Collectors.toList; +import jakarta.ws.rs.core.MultivaluedMap; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; @@ -21,7 +22,6 @@ import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; -import javax.ws.rs.core.MultivaluedMap; import org.apache.ibatis.datasource.pooled.PooledDataSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/taskana-adapter-camunda-spring-boot-test/pom.xml b/taskana-adapter-camunda-spring-boot-test/pom.xml index ca129453..84a0dceb 100644 --- a/taskana-adapter-camunda-spring-boot-test/pom.xml +++ b/taskana-adapter-camunda-spring-boot-test/pom.xml @@ -116,6 +116,12 @@ ${project.version} war + + + org.jboss.resteasy + resteasy-servlet-spring-boot-starter + ${version.resteasy.spring.boot} + com.ibm.db2 @@ -138,11 +144,6 @@ taskana-adapter-camunda-outbox-rest-spring-boot-starter ${project.version} - - org.jboss.resteasy - resteasy-spring-boot-starter - ${version.resteasy.spring.boot} - org.assertj assertj-core @@ -159,6 +160,13 @@ ${version.archunit} test + + + jakarta.annotation + jakarta.annotation-api + ${version.jakarta.annotation} + test + diff --git a/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties b/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties index 02bccaf5..43988d43 100644 --- a/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties +++ b/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties @@ -1,6 +1,10 @@ server.port= 10020 spring.main.allow-bean-definition-overriding=true +# properties for resteasy-servlet-spring-boot-starter +# without these 2 propertiers the camunda-context is registered twice +resteasy.jaxrs.app.registration=property +resteasy.jaxrs.app.classes=pro.taskana.adapter.camunda.outbox.rest.config.OutboxRestServiceConfig ###################################################################################### ## Adapter properties @@ -97,6 +101,9 @@ camunda.bpm.admin-user.password = admin camunda.bpm.admin-user.firstName = admin camunda.bpm.filter.create = All tasks +# new mandatory field starting from camunda version 7.20 +# see https://forum.camunda.io/t/camunda-7-20-history-time-to-live-cannot-be-null-cannot-deploy-wf-created-in-7-18/48159 +camunda.bpm.generic-properties.properties.historyTimeToLive: P180D #Postgres # camunda.datasource.jdbcUrl= jdbc:postgresql://localhost:5432/postgres diff --git a/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties.h2 b/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties.h2 index 94523bf1..17d2935c 100644 --- a/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties.h2 +++ b/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties.h2 @@ -1,6 +1,10 @@ server.port= 10020 spring.main.allow-bean-definition-overriding=true +# properties for resteasy-servlet-spring-boot-starter +# without these 2 propertiers the camunda-context is registered twice +resteasy.jaxrs.app.registration=property +resteasy.jaxrs.app.classes=pro.taskana.adapter.camunda.outbox.rest.config.OutboxRestServiceConfig ###################################################################################### ## Adapter properties diff --git a/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties.postgres b/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties.postgres index 20232bb4..674d4ebf 100644 --- a/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties.postgres +++ b/taskana-adapter-camunda-spring-boot-test/src/main/resources/application.properties.postgres @@ -1,6 +1,10 @@ server.port= 10020 spring.main.allow-bean-definition-overriding=true +# properties for resteasy-servlet-spring-boot-starter +# without these 2 propertiers the camunda-context is registered twice +resteasy.jaxrs.app.registration=property +resteasy.jaxrs.app.classes=pro.taskana.adapter.camunda.outbox.rest.config.OutboxRestServiceConfig ###################################################################################### ## Adapter properties diff --git a/taskana-adapter-camunda-spring-boot-test/src/test/java/pro/taskana/adapter/integration/AbsIntegrationTest.java b/taskana-adapter-camunda-spring-boot-test/src/test/java/pro/taskana/adapter/integration/AbsIntegrationTest.java index d786157d..6dee297f 100644 --- a/taskana-adapter-camunda-spring-boot-test/src/test/java/pro/taskana/adapter/integration/AbsIntegrationTest.java +++ b/taskana-adapter-camunda-spring-boot-test/src/test/java/pro/taskana/adapter/integration/AbsIntegrationTest.java @@ -1,7 +1,7 @@ package pro.taskana.adapter.integration; import com.zaxxer.hikari.HikariDataSource; -import javax.annotation.Resource; +import jakarta.annotation.Resource; import javax.sql.DataSource; import org.camunda.bpm.engine.ProcessEngineConfiguration; import org.junit.jupiter.api.BeforeEach; diff --git a/taskana-adapter-camunda-wildfly-example/pom.xml b/taskana-adapter-camunda-wildfly-example/pom.xml index d167074b..933f3c50 100644 --- a/taskana-adapter-camunda-wildfly-example/pom.xml +++ b/taskana-adapter-camunda-wildfly-example/pom.xml @@ -81,11 +81,12 @@ org.springframework.plugin spring-plugin-core - ${version.spring.core} + ${version.spring.plugin.core} - javax.servlet - javax.servlet-api + jakarta.servlet + jakarta.servlet-api + ${version.jakarta.servlet} provided diff --git a/taskana-adapter/pom.xml b/taskana-adapter/pom.xml index 7bcd3a66..7d781738 100644 --- a/taskana-adapter/pom.xml +++ b/taskana-adapter/pom.xml @@ -37,6 +37,11 @@ taskana-spring ${version.taskana} + + jakarta.annotation + jakarta.annotation-api + ${version.jakarta.annotation} + org.springframework.boot diff --git a/taskana-adapter/src/main/java/pro/taskana/adapter/systemconnector/api/SystemResponse.java b/taskana-adapter/src/main/java/pro/taskana/adapter/systemconnector/api/SystemResponse.java index 4418d19a..847f5a3f 100644 --- a/taskana-adapter/src/main/java/pro/taskana/adapter/systemconnector/api/SystemResponse.java +++ b/taskana-adapter/src/main/java/pro/taskana/adapter/systemconnector/api/SystemResponse.java @@ -1,11 +1,20 @@ package pro.taskana.adapter.systemconnector.api; import org.springframework.http.HttpStatus; +import org.springframework.http.HttpStatusCode; /** encapsulate a response from the external system. */ public class SystemResponse { - private HttpStatus statusCode; - private Throwable throwable; + private final HttpStatus statusCode; + private final Throwable throwable; + + public SystemResponse(int statusCode, Throwable throwable) { + this(HttpStatus.resolve(statusCode), throwable); + } + + public SystemResponse(HttpStatusCode statusCode, Throwable throwable) { + this(HttpStatus.resolve(statusCode.value()), throwable); + } public SystemResponse(HttpStatus statusCode, Throwable throwable) { this.statusCode = statusCode;