Skip to content

Task 04 upgrade java#5

Open
mbjones wants to merge 25 commits into
developfrom
task-04-upgrade-java
Open

Task 04 upgrade java#5
mbjones wants to merge 25 commits into
developfrom
task-04-upgrade-java

Conversation

@mbjones

@mbjones mbjones commented Mar 17, 2026

Copy link
Copy Markdown
Member

PR introduces changes to compile under java 17, 21, and 25. Tested with Eclipse Temurin.

All tests pass. Additional details follow in a summary by Copilot:

Summary

This PR modernizes d1_common_java for current Java LTS/runtime usage, updates CI/build tooling, and aligns dependency/deploy resolution with maven.dataone.org.

It also removes deprecated stylesheet-based XML marshalling behavior that no longer works on modern JDKs and simplifies related code/tests.

Closes #4
Closes #3

Why this change

  • Support current Java versions in active use (17/21/25 testing context, modern compiler/toolchain/plugins).
  • Remove legacy marshalling behavior that is no longer compatible after Java 8.
  • Reduce build/deploy fragility by removing Sonatype assumptions and using DataONE-hosted Maven artifacts.
  • Keep CI aligned with current GitHub Actions versions.

What changed

  • Build and toolchain modernization:
  • Updated Maven compiler/jar plugin setup and cleaned obsolete build config.
  • Refreshed dependency versions (including core logging/common libs).
  • Added/restored test-jar generation needed by downstream consumers.
  • Java/API compatibility cleanup:
  • Replaced deprecated/removed API usage for modern JDK compatibility.
  • Removed obsolete imports and redundant Serializable declarations.
  • Refactored/cleaned affected tests and formatting.
  • Type marshalling behavior:
  • Removed stylesheet injection support from TypeMarshaller marshalling path.
  • Updated tests accordingly.
  • CI and release/deploy updates:
  • Added/updated GitHub Actions Maven workflow.
  • Upgraded workflow actions to current major versions.
  • Switched CI build target to mvn verify.
  • Removed Sonatype deploy workflow/config and moved to maven.dataone.org.
  • Repository/dependency source alignment:
  • Removed Sonatype repository dependence.
  • Configured maven.dataone.org as the source for both release and snapshot artifact resolution.

Behavioral impact

  • Breaking/intentional behavior change:
  • TypeMarshaller stylesheet argument behavior is removed (legacy path no longer supported).
  • Deployment target/source-of-truth for Maven artifacts is now maven.dataone.org.

Validation

  • Project builds and tests pass after modernization changes.
  • CI workflow runs with updated GitHub Actions and Maven verify.
  • d1_test_resources snapshot availability confirmed from maven.dataone.org.

Notes for reviewers

  • This PR includes both modernization and cleanup commits; some diffs are mechanical (imports/formatting) to support compilation and reduce warning noise.
  • Main review focus should be:
  • Type marshalling behavior change.
  • Build/dependency/deploy configuration changes.
  • CI workflow behavior and scope.

@mbjones mbjones requested a review from taojing2002 March 17, 2026 02:29

@taojing2002 taojing2002 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you!

Copilot AI review requested due to automatic review settings May 30, 2026 02:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the Java build and source compatibility for newer JDKs, updates JAXB/logging dependencies, and removes stylesheet injection support from TypeMarshaller.

Changes:

  • Updates Maven configuration/dependencies for modern Java and adds a GitHub Actions Maven build.
  • Migrates Log4j 1.x usages to Log4j 2 API imports.
  • Removes stylesheet marshalling behavior and modernizes tests/source for newer Java and library APIs.

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pom.xml Reworks Java/compiler settings, dependencies, plugins, and release metadata.
.github/workflows/maven.yml Adds Maven CI on GitHub Actions.
src/main/resources/buildInfo/buildInfo.properties Removes filtered build metadata resource.
src/main/java/org/dataone/service/util/TypeMarshaller.java Moves marshalling logic to 2-arg overload and deprecates stylesheet overload.
src/main/java/org/dataone/service/exceptions/BaseException.java Migrates logger to Log4j 2 API.
src/main/java/org/dataone/mimemultipart/MultipartRequestResolver.java Migrates logger and makes it static final.
src/main/java/org/dataone/service/types/v1/TypeFactory.java Migrates logger to Log4j 2 API.
src/main/java/org/dataone/service/types/v1/util/AuthUtils.java Migrates logger and removes unused imports.
src/main/java/org/dataone/service/types/v1/util/ServiceMethodRestrictionUtil.java Migrates logger to Log4j 2 API.
src/main/java/org/dataone/service/types/v1/util/TypeCompareUtil.java Migrates logger to Log4j 2 API.
src/main/java/org/dataone/service/types/v2/util/ServiceMethodRestrictionUtil.java Migrates logger to Log4j 2 API.
src/main/java/org/dataone/service/types/v2/util/ObjectFormatServiceImpl.java Migrates logger to Log4j 2 API.
src/main/java/org/dataone/service/types/v2/TypeFactory.java Replaces deprecated reflective construction and removes unused local variable.
src/main/java/org/dataone/service/util/ExceptionalInputStream.java Replaces boxed Boolean constructors with constants.
src/main/java/org/dataone/service/util/AccessRuleMarshallingAdapter.java Removes unused import.
src/main/java/org/dataone/service/types/v1/ObjectFormatList.java Removes redundant Serializable declaration.
src/main/java/org/dataone/service/types/v1/Permission.java Removes redundant enum Serializable declaration.
src/main/java/org/dataone/service/types/v1/ReplicationStatus.java Removes redundant enum Serializable declaration.
src/main/java/org/dataone/service/types/v1/ServiceMethodRestriction.java Removes redundant Serializable declaration.
src/main/java/org/dataone/service/types/v1_1/QueryEngineList.java Removes unused import.
src/main/java/org/dataone/service/types/v2/Node.java Removes redundant Serializable declaration.
src/main/java/org/dataone/service/types/v2/SystemMetadata.java Removes redundant Serializable declaration.
src/main/java/org/dataone/service/types/v2/OptionList.java Removes unused import.
src/test/java/org/dataone/service/util/TypeMarshallerTestCase.java Updates logger imports and adjusts stylesheet-related tests.
src/test/java/org/dataone/service/util/IdentifierEncodingTestCase.java Updates logger imports and simplifies exception assertions.
src/test/java/org/dataone/service/util/ExceptionHandlerTestCase.java Adds explicit UTF-8 handling and modernizes integer boxing.
src/test/java/org/dataone/service/util/D1Url1TestCase.java Updates logger imports and integer boxing.
src/test/java/org/dataone/service/types/v2/util/NodelistUtilTestCase.java Adds explicit UTF-8 handling.
src/test/java/org/dataone/service/types/v1/SystemMetadataTestCase.java Updates logger imports.
src/test/java/org/dataone/service/types/v2/SystemMetadataTestCase.java Updates logger imports.
src/test/java/org/dataone/service/types/v1/TypeSamplesTestCase.java Updates logger imports and schema URL loading.
src/test/java/org/dataone/service/types/D1NamespaceContext.java Updates logger imports.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pom.xml
Comment thread .github/workflows/maven.yml Outdated
mbjones added 7 commits May 29, 2026 18:16
- Bump joda-time to 2.14.2, httpmime to 4.5.14, and javax.servlet-api to 4.0.1
- Update MultipartRequest for Servlet 3.1+/4.x compatibility by enabling changeSessionId/getContentLengthLong/upgrade
- Add missing HttpUpgradeHandler import and initialize wrapped request in constructor to ensure safe delegation
- Verified with clean build and tests (mvn clean test)
@mbjones

mbjones commented Jun 19, 2026

Copy link
Copy Markdown
Member Author

@taojing2002 can you take another look at this please? Mostly the same, but I did some additional cleanup, and there is a much more detailed overview in the PR description above.

@mbjones mbjones requested a review from taojing2002 June 19, 2026 01:45
@mbjones mbjones self-assigned this Jun 19, 2026
@mbjones mbjones linked an issue Jun 19, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support modern Java versions (LTS 17, 21, 25)

3 participants