diff --git a/.gitignore b/.gitignore index ccf4e954ec..8bafbc1f56 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,9 @@ logs # Maven version backups */*.xml.versionsBackup +# Generated by maven-shade-plugin for repackaging modules +*/dependency-reduced-pom.xml + # The following files are generated/updated by vaadin-maven-plugin */node_modules/ */frontend/generated/ diff --git a/datamanager-app/pom.xml b/datamanager-app/pom.xml index 8ed5a02dad..0385caf5f3 100644 --- a/datamanager-app/pom.xml +++ b/datamanager-app/pom.xml @@ -256,11 +256,6 @@ org.slf4j jcl-over-slf4j - - life.qbic - openbis-api - r1700646105 - org.apache.tomcat.embed tomcat-embed-core diff --git a/datamanager-bom/pom.xml b/datamanager-bom/pom.xml index 2edceacd83..9b2e186510 100644 --- a/datamanager-bom/pom.xml +++ b/datamanager-bom/pom.xml @@ -101,6 +101,11 @@ project-management-infrastructure ${project.version} + + life.qbic.datamanager + openbis-api-clean + ${project.version} + life.qbic.datamanager subscription-api diff --git a/domain-concept/src/main/java/life/qbic/domain/concepts/DomainEvent.java b/domain-concept/src/main/java/life/qbic/domain/concepts/DomainEvent.java index 8239000a2f..49219285be 100644 --- a/domain-concept/src/main/java/life/qbic/domain/concepts/DomainEvent.java +++ b/domain-concept/src/main/java/life/qbic/domain/concepts/DomainEvent.java @@ -1,6 +1,6 @@ package life.qbic.domain.concepts; -import com.fasterxml.jackson.annotation.JsonGetter; +import com.fasterxml.jackson.annotation.JsonProperty; import java.io.Serializable; import java.time.Instant; @@ -14,6 +14,7 @@ */ public abstract class DomainEvent implements Serializable { + @JsonProperty("occurredOn") protected final Instant occurredOn; protected DomainEvent() { @@ -26,7 +27,6 @@ protected DomainEvent() { * @return the instant the of event creation. */ - @JsonGetter("occurredOn") public Instant occurredOn() { return occurredOn; } diff --git a/identity/pom.xml b/identity/pom.xml index 29e3957072..278900d194 100644 --- a/identity/pom.xml +++ b/identity/pom.xml @@ -57,16 +57,10 @@ application-commons - com.fasterxml.jackson.core + tools.jackson.core jackson-core test - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-2-bom.version} - test - org.jobrunr jobrunr @@ -85,6 +79,11 @@ com.fasterxml.jackson.core jackson-annotations + + tools.jackson.core + jackson-databind + test + diff --git a/identity/src/test/groovy/life/qbic/identity/domain/user/event/UserRegisteredEventSpec.groovy b/identity/src/test/groovy/life/qbic/identity/domain/user/event/UserRegisteredEventSpec.groovy index 8165ffefeb..bd9019ff7c 100644 --- a/identity/src/test/groovy/life/qbic/identity/domain/user/event/UserRegisteredEventSpec.groovy +++ b/identity/src/test/groovy/life/qbic/identity/domain/user/event/UserRegisteredEventSpec.groovy @@ -1,19 +1,17 @@ package life.qbic.identity.domain.user.event -import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.databind.json.JsonMapper -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule import life.qbic.identity.domain.event.UserRegistered import spock.lang.Specification +import tools.jackson.databind.ObjectMapper class UserRegisteredEventSpec extends Specification { def "Ensure serialisation and deserialisation"() { given: UserRegistered userRegistered = UserRegistered.create("1234", "Sven", "sven.fillinger@test.de") + ObjectMapper objectMapper = new ObjectMapper(); when: - ObjectMapper objectMapper = JsonMapper.builder().addModule(new JavaTimeModule()).build() String json = objectMapper.writeValueAsString(userRegistered) UserRegistered deserialised = objectMapper.readValue(json, UserRegistered) diff --git a/openbis-api-clean/pom.xml b/openbis-api-clean/pom.xml new file mode 100644 index 0000000000..3723a8d178 --- /dev/null +++ b/openbis-api-clean/pom.xml @@ -0,0 +1,167 @@ + + + 4.0.0 + + life.qbic.datamanager + datamanager + 1.15.0 + + + openbis-api-clean + OpenBIS API (de-collided) + + Repackaging of the upstream life.qbic:openbis-api shaded uber-jar that relocates bundled + third-party packages into a private namespace. + + Rationale: the upstream artifact is a shaded uber-jar that bundles old (2017-era) copies of + third-party libraries under the same fully-qualified names as the real runtime dependencies. + Depending on classpath ordering these collide with the real libraries. Relocating them to + life.qbic.openbis.shaded.* rewrites both the bundled class files and the references inside the + openbis client classes, so openbis keeps behaving exactly as before while the real libraries + remain the single source of those types at compile time and runtime. + + + + + + life.qbic + openbis-api + 20.10.7.3 + r1700646105 + true + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.5.0 + + + default-jar-early + compile + + jar + + + + default-jar + none + + + + + + + org.apache.maven.plugins + maven-shade-plugin + 3.6.0 + + true + + + + org.springframework + life.qbic.openbis.shaded.org.springframework + + + + org.apache + life.qbic.openbis.shaded.org.apache + + + + org.aspectj + life.qbic.openbis.shaded.org.aspectj + + + + org.eclipse + life.qbic.openbis.shaded.org.eclipse + + + + org.slf4j + life.qbic.openbis.shaded.org.slf4j + + + + org.aopalliance + life.qbic.openbis.shaded.org.aopalliance + + + + com.fasterxml + life.qbic.openbis.shaded.com.fasterxml + + + + + + + + + relocate + compile + + shade + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.1.0 + + + unpack-relocated + compile + + run + + + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 026216559c..c77d677e12 100644 --- a/pom.xml +++ b/pom.xml @@ -29,6 +29,7 @@ domain-concept identity-api identity-infrastructure + openbis-api-clean project-management-infrastructure email-service-provider finances-infrastructure diff --git a/project-management-infrastructure/pom.xml b/project-management-infrastructure/pom.xml index ab4302eedf..94f1e791af 100644 --- a/project-management-infrastructure/pom.xml +++ b/project-management-infrastructure/pom.xml @@ -20,9 +20,8 @@ logging - life.qbic - openbis-api - r1700646105 + life.qbic.datamanager + openbis-api-clean org.springframework @@ -98,6 +97,17 @@ org.springframework.boot spring-boot-jackson + + + com.fasterxml.jackson.core + jackson-databind + jakarta.xml.bind