From 0dc82500728165a099685989d38b86ad9f9cc7b7 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Mon, 24 Jan 2022 16:14:03 +0100 Subject: [PATCH 1/7] ci(unit): experimental Java 17 Maven Unittest build #8094 This adds an experimental build on the Github Workflows for IQSS/dataverse using Java 17. See reference docs https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error --- .github/workflows/maven_unit_test.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/maven_unit_test.yml b/.github/workflows/maven_unit_test.yml index 464d60c2db6..534e809ef0a 100644 --- a/.github/workflows/maven_unit_test.yml +++ b/.github/workflows/maven_unit_test.yml @@ -14,12 +14,13 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-latest ] jdk: [ '11' ] - #include: - # - os: ubuntu-latest - # jdk: '16' - runs-on: ${{ matrix.os }} + experimental: [false] + include: + - jdk: '17' + experimental: true + continue-on-error: ${{ matrix.experimental }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up JDK ${{ matrix.jdk }} From e6a72e21333386d94d925b2574fa4b4132297753 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 25 Jan 2022 18:07:55 +0100 Subject: [PATCH 2/7] ci(unit): flag experimental builds of unit tests in results #8094 --- .github/workflows/maven_unit_test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/maven_unit_test.yml b/.github/workflows/maven_unit_test.yml index 534e809ef0a..56065c196f7 100644 --- a/.github/workflows/maven_unit_test.yml +++ b/.github/workflows/maven_unit_test.yml @@ -10,15 +10,17 @@ on: jobs: unittest: - name: (JDK ${{ matrix.jdk }} / ${{ matrix.os }}) Unit Tests + name: (${{ matrix.status}} / JDK ${{ matrix.jdk }}) Unit Tests strategy: fail-fast: false matrix: jdk: [ '11' ] experimental: [false] + status: ["Stable"] include: - jdk: '17' experimental: true + status: "Experimental" continue-on-error: ${{ matrix.experimental }} runs-on: ubuntu-latest steps: From f411f2ef5a4036d8d629a1af321cb9e4542f0c3e Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Wed, 26 Jan 2022 09:43:56 +0100 Subject: [PATCH 3/7] chore(build): update to JaCoCo 0.8.7 to enable Java 17 coverage #8094 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e9ce029484d..490c6db28b0 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ 2.28.2 5.2.4 1.20.1 - 0.8.6 + 0.8.7 From c758adea0442da442eae2657fd0647d8f03dd14b Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Wed, 26 Jan 2022 10:02:07 +0100 Subject: [PATCH 4/7] build(mvn): dissolve Java9+ profile and make target version a var #8094 --- pom.xml | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index 490c6db28b0..9feb3283949 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,7 @@ -Duser.timezone=${project.timezone} -Dfile.encoding=${project.build.sourceEncoding} -Duser.language=${project.language} -Duser.region=${project.region} false + 11 8.0.0 5.2021.5 42.2.19 @@ -824,6 +825,16 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + ${target.java.version} + + ${compilerArgument} + + org.apache.maven.plugins maven-jar-plugin @@ -947,26 +958,6 @@ all-unit-tests - - Java9Plus - - [1.9 - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 11 - - ${compilerArgument} - - - - - tc From b7420f09610aec5f7d67121fa18cf1033db76966 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Wed, 26 Jan 2022 10:05:59 +0100 Subject: [PATCH 5/7] build(mvn): update Maven Surefire to 3.0 #8094 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9feb3283949..d4b4fb7f2d6 100644 --- a/pom.xml +++ b/pom.xml @@ -916,7 +916,7 @@ maven-surefire-plugin - 2.22.2 + 3.0.0-M5 ${testsToExclude} From 5fd728baf3d22a61763e7e9d878a17d4e347a47e Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Wed, 26 Jan 2022 10:11:22 +0100 Subject: [PATCH 6/7] ci(unit): override Maven target Java version from build matrix #8094 --- .github/workflows/maven_unit_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven_unit_test.yml b/.github/workflows/maven_unit_test.yml index 56065c196f7..70363112050 100644 --- a/.github/workflows/maven_unit_test.yml +++ b/.github/workflows/maven_unit_test.yml @@ -37,7 +37,7 @@ jobs: key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - name: Build with Maven - run: mvn -DcompilerArgument=-Xlint:unchecked -P all-unit-tests clean test + run: mvn -DcompilerArgument=-Xlint:unchecked -Dtarget.java.version=${{ matrix.jdk }} -P all-unit-tests clean test - name: Maven Code Coverage env: CI_NAME: github From fbf25714269129d97c2e24f11312e3ba41d973fd Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Wed, 26 Jan 2022 11:07:55 +0100 Subject: [PATCH 7/7] fix(harvest): make XlistRecordsHandler Java 17 ready #8094 --- .../server/xoai/XlistRecordsHandler.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/harvest/server/xoai/XlistRecordsHandler.java b/src/main/java/edu/harvard/iq/dataverse/harvest/server/xoai/XlistRecordsHandler.java index 5651545e505..8fe13bc4044 100644 --- a/src/main/java/edu/harvard/iq/dataverse/harvest/server/xoai/XlistRecordsHandler.java +++ b/src/main/java/edu/harvard/iq/dataverse/harvest/server/xoai/XlistRecordsHandler.java @@ -1,29 +1,37 @@ package edu.harvard.iq.dataverse.harvest.server.xoai; import com.lyncode.xml.exceptions.XmlWriteException; -import com.lyncode.xoai.dataprovider.handlers.*; -import com.lyncode.xoai.dataprovider.exceptions.*; +import com.lyncode.xoai.dataprovider.exceptions.BadArgumentException; +import com.lyncode.xoai.dataprovider.exceptions.CannotDisseminateFormatException; +import com.lyncode.xoai.dataprovider.exceptions.CannotDisseminateRecordException; +import com.lyncode.xoai.dataprovider.exceptions.DoesNotSupportSetsException; +import com.lyncode.xoai.dataprovider.exceptions.HandlerException; +import com.lyncode.xoai.dataprovider.exceptions.NoMatchesException; +import com.lyncode.xoai.dataprovider.exceptions.NoMetadataFormatsException; +import com.lyncode.xoai.dataprovider.exceptions.OAIException; +import com.lyncode.xoai.dataprovider.handlers.VerbHandler; import com.lyncode.xoai.dataprovider.handlers.results.ListItemsResults; import com.lyncode.xoai.dataprovider.handlers.helpers.ItemHelper; import com.lyncode.xoai.dataprovider.handlers.helpers.ItemRepositoryHelper; -import com.lyncode.xoai.dataprovider.handlers.helpers.ResumptionTokenHelper; import com.lyncode.xoai.dataprovider.handlers.helpers.SetRepositoryHelper; import com.lyncode.xoai.dataprovider.model.Context; import com.lyncode.xoai.dataprovider.model.Item; import com.lyncode.xoai.dataprovider.model.MetadataFormat; import com.lyncode.xoai.dataprovider.model.Set; -import com.lyncode.xoai.model.oaipmh.*; import com.lyncode.xoai.dataprovider.parameters.OAICompiledRequest; import com.lyncode.xoai.dataprovider.repository.Repository; +import com.lyncode.xoai.model.oaipmh.Header; +import com.lyncode.xoai.model.oaipmh.ListRecords; +import com.lyncode.xoai.model.oaipmh.Metadata; +import com.lyncode.xoai.model.oaipmh.Record; +import com.lyncode.xoai.model.oaipmh.ResumptionToken; import com.lyncode.xoai.xml.XSLPipeline; import com.lyncode.xoai.xml.XmlWriter; import edu.harvard.iq.dataverse.Dataset; import javax.xml.stream.XMLStreamException; -import javax.xml.transform.TransformerException; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.IOException; import java.util.List; /**