From 76830873c424e299403db3dc50fdd78d73dc139f Mon Sep 17 00:00:00 2001 From: Gavin Baumanis Date: Tue, 25 Aug 2026 16:50:39 +1000 Subject: [PATCH 1/4] Release 11.0.0: Java 11 / jakarta --- .cursor/rules/ascii-source.mdc | 22 +++ .cursor/rules/common-library-project.mdc | 47 +++++++ .cursor/rules/documentation-standards.mdc | 50 +++++++ .cursor/rules/multi-branch-worktrees.mdc | 45 ++++++ .cursor/rules/worktrees.mdc | 37 +++++ AGENTS.md | 13 ++ CHANGELOG.md | 40 ++++-- CONTRIBUTING.md | 62 +++++---- LICENSE.txt | 51 +++---- MAINTAINERS.md | 103 ++++++++++++++ README.md | 100 ++++++++------ SECURITY.md | 12 ++ pom.xml | 100 +++++++++----- settings.xml.example | 28 ++++ .../nehta/vendorlibrary/common/DOMUtil.java | 2 +- .../nehta/vendorlibrary/common/JAXBUtil.java | 4 +- .../nehta/vendorlibrary/ws/TimeUtility.java | 99 +++++-------- .../ws/WebServiceClientUtil.java | 10 +- .../ws/handler/LoggingHandler.java | 10 +- .../gov/nehta/vendorlibrary/xml/XmlUtil.java | 8 +- .../gov/nehta/vendorlibrary/xml/_XmlUtil.java | 2 +- .../common/security/KeystoreUtilTest.java | 130 ++++++++---------- .../vendorlibrary/ws/TimeUtilityTest.java | 16 ++- 23 files changed, 690 insertions(+), 301 deletions(-) create mode 100644 .cursor/rules/ascii-source.mdc create mode 100644 .cursor/rules/common-library-project.mdc create mode 100644 .cursor/rules/documentation-standards.mdc create mode 100644 .cursor/rules/multi-branch-worktrees.mdc create mode 100644 .cursor/rules/worktrees.mdc create mode 100644 AGENTS.md create mode 100644 MAINTAINERS.md create mode 100644 SECURITY.md create mode 100644 settings.xml.example diff --git a/.cursor/rules/ascii-source.mdc b/.cursor/rules/ascii-source.mdc new file mode 100644 index 0000000..ad837c1 --- /dev/null +++ b/.cursor/rules/ascii-source.mdc @@ -0,0 +1,22 @@ +--- +description: Tracked source and docs must be ASCII only +alwaysApply: true +--- + +# ASCII source + +Every file you **add or edit** must be **ASCII only** (bytes 0x00-0x7F). Scan touched paths before finishing. + +Replace: + +| Non-ASCII | ASCII | +| ------------------ | ----------- | +| em/en dash, minus | `-` | +| ellipsis | `...` | +| curly quotes | `'` / `"` | +| arrows | `->` / `<-` | +| non-breaking space | space | + +Do not introduce Unicode symbols, emoji, or locale punctuation in code, comments, XML, or docs. + +WSDL/XSD copied from the licensed toolkit may contain non-ASCII. Do not add more. Prefer ASCII in files you author. diff --git a/.cursor/rules/common-library-project.mdc b/.cursor/rules/common-library-project.mdc new file mode 100644 index 0000000..329c85c --- /dev/null +++ b/.cursor/rules/common-library-project.mdc @@ -0,0 +1,47 @@ +--- +description: common-library-java artifact repo layout, release lines, and build +alwaysApply: true +--- + +# common-library-java + +Maven artifact **`au.gov.nehta:common-library`** - shared Java utility classes used by other ADHA/NEHTA libraries (CDA package operations, argument validation, web-service helpers). + +## Documentation + +Follow **`documentation-standards.mdc`**. Integrator docs use **version numbers** - not Git branch names. + +The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** target, aligned with the HI/MHR client release lines. + +| Version | Java | XML stack | +| ------------ | ---- | ----------- | +| **8.0.0** | 8 | **javax** | +| **11.0.0** | 11 | **Jakarta** | +| **17.0.0.1** | 17 | **Jakarta** | +| **21.0.0.1** | 21 | **Jakarta** | +| **24.0.0.1** | 24 | **Jakarta** | + +**Git branch mapping (maintainers only - never in integrator docs):** + +| Version | Official Git branch | +| ------------ | ------------------- | +| **8.0.0** | `java-8` | +| **11.0.0** | `java-11` | +| **17.0.0.1** | `java-17` | +| **21.0.0.1** | `java-21` | +| **24.0.0.1** | `java-24` | + +## This 11.0.0 line + +**`11.0.0-SNAPSHOT`**: Java **11**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. + +## Build + +- JDK **11+**, from repo root: `mvn -B "-Dgpg.skip=true" clean verify` (quote `-D` on PowerShell). + +## Doc split + +- **`documentation-standards.mdc`**: implementor-first, Maven Central default, local/OS sections, relative paths, no secrets +- **`README.md`**: integrators (Maven Central default) +- **`CONTRIBUTING.md`**: build from source, local SNAPSHOT install +- **`MAINTAINERS.md`**: POM internals diff --git a/.cursor/rules/documentation-standards.mdc b/.cursor/rules/documentation-standards.mdc new file mode 100644 index 0000000..778c751 --- /dev/null +++ b/.cursor/rules/documentation-standards.mdc @@ -0,0 +1,50 @@ +--- +description: Documentation and build scripts - implementor-first, Maven Central default, no secrets +alwaysApply: true +--- + +# Documentation and build scripts + +Applies when writing or editing **README**, **CONTRIBUTING**, integrator guides, **SECURITY**, release notes, **build.*** / **build.xml** header comments, **settings.xml.example**, **local.properties.example**, and similar tracked material. + +## Priority: implementors + +- Primary audience: developers **consuming** published Maven artifacts. +- Contributor/maintainer workflow lives in **CONTRIBUTING.md**, **MAINTAINERS.md**, or labelled subsections - not mixed into the integrator main flow. +- Do not duplicate agent workflow in README or CONTRIBUTING (**AGENTS.md** -> `.cursor/rules/`). + +## Default narrative: Maven Central + +- Write as if **released** coordinates are on Maven Central (no SNAPSHOT, sibling-repo checkout, or `-P...` profiles in the main integrator path). +- Use **version numbers** in integrator docs - not Git branch names. +- SNAPSHOT installs and sibling `mvn install` belong under **Local development** / **Local builds** only. + +## Structure + +| Where | What | +| ----- | ---- | +| README / integrator docs | Dependency, runtime config, capabilities | +| Local development | Unpublished builds, SNAPSHOT, source-tree prerequisites | +| By OS (when needed) | Separate **Windows**, **macOS**, **Linux** blocks (wrappers, cleanup, path notes) | + +## Paths + +- **Relative paths only** (e.g. `src/main/resources/`, `pom.xml` beside repo root). +- **Never** hardcode machine paths (`C:\...`, `/Users/...`, `~/`, worktree folders) in tracked docs. +- Override only when strictly required to remove ambiguity - say why. + +## Current state only + +- No migration, legacy, or branch-history commentary in user-facing docs. +- Describe **what is true now**; omit "removed", "used to", and repo archaeology in integrator material. +- **CHANGELOG** entries: current release capabilities; avoid branch names and migration essays in new notes. + +## Secrets - MUST NOT + +- **Never** put real or plausible **passwords**, **tokens**, **API keys**, **private keys**, or **keystore passphrases** in tracked files (code, comments, examples, docs). +- Use placeholders or empty values in `.example` files. +- See **SECURITY.md**. + +## Override + +These rules may be overridden **only when necessary** to clear ambiguity (e.g. maintainer branch mapping in **MAINTAINERS.md** or `.cursor/rules/`, clearly labelled maintainer-only). diff --git a/.cursor/rules/multi-branch-worktrees.mdc b/.cursor/rules/multi-branch-worktrees.mdc new file mode 100644 index 0000000..aa0018b --- /dev/null +++ b/.cursor/rules/multi-branch-worktrees.mdc @@ -0,0 +1,45 @@ +--- +description: Use git worktree when editing multiple branches of the same repository +alwaysApply: true +--- + +# Multi-branch work - use git worktree + +When a task requires **changes on two or more branches of the same Git repository**, use **`git worktree`** - do **not** hop branches with `git checkout` while carrying uncommitted edits or stashes. + +## When this applies + +- Same-repo edits across release lines (e.g. `java-8`, `java-11`) +- Applying the same fix to several branches before commit +- Comparing or building two branches side by side + +## When checkout is fine + +- Single branch for the whole task +- Read-only inspection: `git show :path` +- Clean working tree and only one target branch + +## Workflow + +1. **Primary clone** stays on the main working branch; do not stash-and-hop to edit other branches. +2. **Add a worktree per extra branch** (paths are local - never commit them to tracked docs): + + ```bash + git worktree add ../- + ``` + +3. **Edit and commit in each worktree** independently; verify build/tests per branch. +4. **Remove when done**: `git worktree remove ../-` (or `git worktree prune` after manual delete). + +## Do not + +- `git checkout` other branches with uncommitted changes (Git will block or force stash churn). +- Stash the same files across multiple branch switches - causes merge conflicts on `stash pop`. +- Put worktree directory paths in README, CONTRIBUTING, or other tracked docs (see repo **`worktrees.mdc`** / **`documentation-standards.mdc`**). + +## Example (maintainer-local paths only) + +```bash +git worktree add java-8 +git worktree add java-11 +``` diff --git a/.cursor/rules/worktrees.mdc b/.cursor/rules/worktrees.mdc new file mode 100644 index 0000000..ee4b788 --- /dev/null +++ b/.cursor/rules/worktrees.mdc @@ -0,0 +1,37 @@ +--- +description: Worktree paths are local only - versions belong in integrator docs +alwaysApply: true +--- + +# Worktrees (local convenience only) + +**`git worktree`** lets a maintainer check out multiple branches of the **same repository** at once. Worktree **directory paths are machine-specific** and must **not** appear in tracked documentation. + +## What tracked docs describe + +Follow **`documentation-standards.mdc`** (implementor-first, Maven Central default). + +| Doc | Audience | Use | +| --- | --------- | --- | +| **README**, integrator guides | Implementors | **Maven version** (`11.0.0`), Central coordinates, JAR contents | +| **CONTRIBUTING** | Contributors | Build from source, **Local builds**, OS-specific steps | +| **MAINTAINERS**, **`.cursor/rules/`** | Maintainers | POM internals; **branch mapping** only when labelled maintainer-only | + +Integrator docs: **version numbers**, not Git branch names. Local/SNAPSHOT flows: **CONTRIBUTING** only. + +## Do not put in tracked docs + +- Hardcoded worktree or machine paths (`wt/`, `C:\...`, `/Users/...`, `~/`, `this worktree`, `primary clone`) +- References to **`wt/README.md`** or other local-only layout files +- "Open folder X to switch branches" - IDE/local workflow, not repo documentation + +## Allowed (maintainer-only, when labelled) + +- **Git branch mapping** table (version -> branch) in **MAINTAINERS.md** or agent rules +- Generic worktree example only: `git worktree add ` (placeholder **``**, never a committed example) +- Optional **untracked** local notes outside the repo + +## When editing docs + +1. Identify the **Maven version / release line** the text applies to, not the worktree folder Cursor has open. +2. Remove or rewrite any committed worktree path tables or branch names in integrator-facing files. diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..3c9319f --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,13 @@ +# Cursor agents + +Rules: `.cursor/rules/*.mdc`. Do not duplicate in README or CONTRIBUTING. + +| Concern | Rule | +|---------|------| +| ASCII only in authored files | `ascii-source.mdc` | +| Documentation and build scripts (implementor-first, Central, local, OS, paths, no secrets) | `documentation-standards.mdc` | +| common-library scope, build, version lines | `common-library-project.mdc` | +| Worktrees local only; versions in integrator docs | `worktrees.mdc` | +| Multi-branch edits in one repo - use worktree, not checkout/stash | `multi-branch-worktrees.mdc` | + +Contributors (humans): README, CONTRIBUTING, MAINTAINERS, SECURITY, CHANGELOG. diff --git a/CHANGELOG.md b/CHANGELOG.md index 8907702..de56e4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,28 @@ # Change Log/Revision History -= 1.1.1 = -========= -- Converted to Maven -- Changed dependencies to use Maven references - -= 1.1.0 = -======= -- updated the supplied nehta-smi-xsp library to the 1.2.0 version which supports Java 1.7_21+ -- deprecated use of verifySignature(Document,CertificateVerifier) in favour of verifySignature(Document,CertificateValidator) -- changed Logging handler implementation to avoid XML transformations. - -= 1.0.4 = -======= -- modified WebServiceClient to add both com.sun.xml and com.sun.xml.internal binding for SSL factory \ No newline at end of file +# = 11.0.0 = + +- Maven **`au.gov.nehta:common-library`** **11.0.0** (Java **11** / **Jakarta**). +- POM: Jakarta XML APIs, **`jaxws-rt` 4.0.5**; declare bind/ws/soap APIs used by sources. +- **`smi-xsp`** at **`nehta.xsp.lib.version`** = **`${project.version}`** (**11.0.0**). +- `TimeUtility` uses `java.time` (`DateTimeFormatter` / `LocalDateTime`) instead of `SimpleDateFormat`. +- Drop unused test-only `xmlsec` / `slf4j` declarations (arrive via `smi-xsp` / runtime as needed). + +# = 1.2.3-SNAPSHOT = + +- Updated pom and deployed. + +# = 1.1.1 = + +- Converted to Maven. +- Changed dependencies to use Maven references. + +# = 1.1.0 = + +- Updated the supplied nehta-smi-xsp library to the 1.2.0 version which supports Java 1.7_21+. +- Deprecated use of `verifySignature(Document,CertificateVerifier)` in favour of `verifySignature(Document,CertificateValidator)`. +- Changed Logging handler implementation to avoid XML transformations. + +# = 1.0.4 = + +- Modified WebServiceClient to add both com.sun.xml and com.sun.xml.internal binding for SSL factory. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a5b9a08..10c276e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,41 +1,47 @@ -# How to contribute +# Contributing -Thanks for your interest in contributing to this project. +**Audience:** developers building or changing **this repository**. Integrators should use **README.md** and Maven Central coordinates. See **SECURITY.md** before committing. -You can find out a bit more about this project by reading the [README](README.md) -file within this repository. +## Prerequisites -## Reporting issues +- **JDK 11+** with **`JAVA_HOME`** set (see **`maven.compiler.release`** in **`pom.xml`**). +- **Maven 3.6+** on **`PATH`**. -Issues can be used to: +Dependencies resolve from **[Maven Central](https://central.sonatype.com/)** unless you are installing a **local SNAPSHOT** (below). This POM has no sibling Maven modules. -- Report a defect -- Request a new feature or enhancement -- Ask a question +## Versioning -New issues will be automatically populated with a template that highlights the -information that needs to be submitted with an issue that describes a defect. If -the issue is not related to a defect, please just delete the template and -replace it with a detailed description of the problem you are trying to solve. +The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** version that this library targets. **11.0.0** targets Java **11** / **Jakarta**; **8.0.0** uses **`javax`**. See **`README.md`**. -## Creating a pull request +## Build -New pull requests within this project's repository are pre-populated with a -checklist that describes the Definition of Done that we assess all new changes -against. It is ok to submit a pull request that has not yet addressed all of -these items, but be aware that the change will not be merged until it meets the -Definition of Done. +From the project root: -Please communicate with us (preferably through creation of an issue) before -embarking on any significant work within a pull request. This will prevent -situations where people are working at cross-purposes. +```text +mvn -B "-Dgpg.skip=true" clean verify +``` -## Code of conduct +| Goal | Command | +| ---------------------------------------------- | ---------------------------------------------------------- | +| Compile + attach sources/Javadoc | `mvn -B "-Dgpg.skip=true" clean verify` | +| Skip tests | `mvn -B "-Dgpg.skip=true" clean verify "-DskipTests=true"` | +| Install SNAPSHOT to the local Maven repository | `mvn -B "-Dgpg.skip=true" clean install` | -Before making a contribution, please read the -[code of conduct](CODE_OF_CONDUCT.md). +GPG signing is skipped by default (**`-Dgpg.skip=true`**). Release builds: **`-Dgpg.skip=false`**. -## Contact us +## Dependencies -You can alo raise a query about this code, by emailing: -[help@digitalhealth.gov.au](mailto:help@digitalhealth.gov.au) +- Runtime SOAP stack: **`com.sun.xml.ws:jaxws-rt` 4.0.5** (plus declared Jakarta bind / WS / SOAP APIs). +- Sibling **`au.gov.nehta:smi-xsp`** at the same Maven version (**`${project.version}`**). +- Test: **`junit`**. + +## Local builds (unpublished artifacts) + +**`mvn install`** makes the SNAPSHOT resolvable for any local consumer of **`au.gov.nehta:common-library`** at **`${project.version}`**. Integrators using GA versions from Maven Central do not need a source checkout. + +Maintainer notes: **MAINTAINERS.md**. + +## Repository hygiene + +- **Do not commit** keystores, production endpoint URLs, populated **`settings.xml`** with release credentials, or generated build artefacts. See **SECURITY.md**. +- **Line endings:** the repository uses **LF** (see **`.gitattributes`** if present). On **Windows**, run **`git config core.autocrlf false`** in your clone before committing. diff --git a/LICENSE.txt b/LICENSE.txt index 2bb02e8..d37530a 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,28 +1,31 @@ -Australian Digital Health Agency Production Disclaimer - +NEHTA (as Licensor) grants You a licence to this Product subject to +the terms of the Apache Licence (version 2.0), a copy of which is +available at http://www.apache.org/licenses/LICENSE-2.0, and the +following terms. -The Australian Digital Health Agency (as Licensor) grants You a -licence to this Product subject to the terms of the Apache Licence -(version 2.0), a copy of which is available at -http://www.apache.org/licenses/LICENSE-2.0, and the following terms. - -This Product licensed under the Apache Licence and these terms may -be used within production software systems. It nevertheless remains -your responsibility to test and validate the use of this product -within your software and the limitation of liability provisions in -clause 8 of the Apache Licence continue to apply. +This Product licensed under the Apache Licence and these terms is +not at a production stage and is accordingly licensed for +non-production use only. This Product should in no circumstance be +used for the processing of personal or patient data in a clinical +or operational setting, or in the provision of medical or +therapeutic advice or treatment in a clinical or operational +setting. In addition to clause 4(a) of the Apache Licence, You +must provide a copy of these terms to a recipient of any Work or +Derivative Works in addition to the Apache Licence to the extent +that NEHTA is a Contributor in respect of those Works or Derivative +Works. -Despite clause 7 of the Apache Licence, if a condition or warranty -is implied by statute or law that cannot be excluded, then the -liability of a Contributor to the extent that it has contributed to -a breach of that condition or warranty is limited to one or more of -the following at its option: (a) in the case of goods, any one of -the following: the replacement of those goods or the re-supply of -equivalent goods; the repair of those goods; the payment of the -cost of replacing those or acquiring equivalent goods; or the -payment of the cost of having those goods repaired; and (b) in the -case of services: the supplying of those services again; or the +Despite clause 7 of the Apache Licence, if a condition or warranty +is implied by statute or law that cannot be excluded, then the +liability of a Contributor to the extent that it has contributed to +a breach of that condition or warranty is limited to one or more of +the following at its option: (a) in the case of goods, any one of +the following: the replacement of those goods or the re-supply of +equivalent goods; the repair of those goods; the payment of the +cost of replacing those or acquiring equivalent goods; or the +payment of the cost of having those goods repaired; and (b) in the +case of services: the supplying of those services again; or the payment of the cost of having those services supplied again. - -A term which is given a meaning in the Apache Licence, has the same -meaning when used in these terms. +A term which is given a meaning in the Apache Licence, has the same +meaning when used in these terms. diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 0000000..54edf8a --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,103 @@ +# Maintainer notes + +**Audience:** people changing the **`common-library`** build, source, or release process - not library integrators. Integrators should use **README.md**, published Javadoc, and **`pom.xml`** coordinates. + +Paths are relative to the repository root (directory containing **`pom.xml`**). + +## Versioning + +The **first number** of **``** is the **Java SE** target of **this** library. + +| Maven version | Java SE | +| ------------- | ------- | +| **8.0.0** | **8** | +| **11.0.0** | **11** | +| **17.0.0.1** | **17** | +| **21.0.0.1** | **21** | +| **24.0.0.1** | **24** | + +**Documentation convention:** README, CONTRIBUTING, CHANGELOG, and integrator-facing text use **version numbers only** - never Git branch names. + +| Version | Java | XML APIs | +| ------------ | ---- | --------------------------------------------------------------- | +| **8.0.0** | 8 | **`javax.xml.ws`**, **`javax.xml.bind`** (via `jaxws-rt` 2.3.7) | +| **11.0.0** | 11 | **Jakarta** XML WS / Bind | +| **17.0.0.1** | 17 | **Jakarta** XML WS / Bind | +| **21.0.0.1** | 21 | **Jakarta** XML WS / Bind | +| **24.0.0.1** | 24 | **Jakarta** XML WS / Bind | + +**Git branch mapping (maintainers / checkout only - do not use in integrator docs):** + +| Version | Official Git branch | +| ------------ | ------------------- | +| **8.0.0** | `java-8` | +| **11.0.0** | `java-11` | +| **17.0.0.1** | `java-17` | +| **21.0.0.1** | `java-21` | +| **24.0.0.1** | `java-24` | + +Artifact id stays **`common-library`**; the version distinguishes the Java SE line. + +On a given branch, **do not change the first number** of **``**. Next GA on **`java-11`** is **`11.0.0.2`** (then **`11.0.1-SNAPSHOT`**), not a different first number. A new Java SE target is a **new branch**, not a bump on this one. + +**This checkout (`11.0.0-SNAPSHOT`):** Java **11**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. + +## Artifact + +- **`au.gov.nehta:common-library`** - shared utility classes for CDA package operations, argument validation, and web-service helpers used by other ADHA/NEHTA libraries. + +## Contributors vs release publisher (`pom.xml`) + +**Contributors (PRs, ordinary commits):** Do not change **``** (stay on **`-SNAPSHOT`** unless the maintainer requests a bump), **``**, or **`distributionManagement`**. Leave **`maven-gpg-plugin`** **`skip`** **`true`** so default **`mvn verify`** does not require a signing key. Record user-visible work under **`CHANGELOG.md`** in the **`= =`** block that matches **`pom.xml`** **``**. + +**Release publisher:** In the release change set: set **``** to the GA coordinate (no **`-SNAPSHOT`**); set **``** to the Git tag you will publish. Move **`CHANGELOG.md`** bullets from the snapshot section into a new **`= =`** section; add a fresh **`-SNAPSHOT`** block for the next development cycle. Deploy via Sonatype Central Portal (**`central-publishing-maven-plugin`**; copy **`settings.xml.example`** -> **`settings.xml`**, server id **`central`**). See **Release** below. + +## Release + +Publishing uses **`central-publishing-maven-plugin`** (Sonatype Central Portal). Copy **`settings.xml.example`** -> **`settings.xml`**, server id **`central`**. + +| Branch | Java | `common-library` | +| ------------- | ------------ | ---------------- | +| **`java-8`** | 8 / javax | **8.0.0** | +| **`java-11`** | 11 / Jakarta | **11.0.0** | +| **`java-17`** | 17 / Jakarta | **17.0.0.1** | +| **`java-21`** | 21 / Jakarta | **21.0.0.1** | +| **`java-24`** | 24 / Jakarta | **24.0.0.1** | + +**`-DdevelopmentVersion`:** keep the same first number as **`-DreleaseVersion`** (example on this line: **`11.0.0`** then **`11.0.1-SNAPSHOT`**). + +### SNAPSHOT or manual GA + +1. Update **CHANGELOG.md** (and **`pom.xml`** / SCM **``** for manual GA). +2. **`mvn -B "-Prelease" clean verify`** +3. **`mvn -B "-Prelease" deploy`** + +Tags default to **`{artifactId}-{version}`** (e.g. **`common-library-11.0.0`**). + +### Automated GA (`maven-release-plugin`) + +Run on the **target branch** with a **clean** working tree. + +```text +mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=11.0.0 -DdevelopmentVersion=11.0.1-SNAPSHOT -Dtag=common-library-11.0.0 +``` + +**After success:** confirm **`common-library`** GA on Central before cutting downstream GAs. + +## Changelog and releases + +**`CHANGELOG.md`** uses **`= version =`** section headers. Match the snapshot header to **`pom.xml`** **``** until the publisher cuts GA. + +## New Java SE line + +When adding a line (e.g. Java **25**): create **`java-25`** in **this** repository from the nearest existing line; set **``** first number to **25** (e.g. **`25.0.0.1-SNAPSHOT`**); set **`maven.compiler.release`**, Jakarta coordinates, CI **`java-version`** / branch filter, and docs to that line. Do not retarget an existing branch. + +## Build (`11.0.0` line) + +- **`maven.compiler.release` 11** +- Runtime SOAP stack: **`com.sun.xml.ws:jaxws-rt` 4.0.5** in **consuming** applications +- **`maven-gpg-plugin`:** skipped unless **`-Dgpg.skip=false`** + +## Copyright + +Copyright 2011 NEHTA. Copyright 2021-2026 ADHA. Apache License 2.0 - see **LICENSE.txt**. diff --git a/README.md b/README.md index c94655a..e2a430a 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,79 @@ # Common Library -This is a Java software library that supports producing, validating and extracting clinical packages as documented in the "CDA Package" specification. -Setup -===== -- To build and test the distributable package, an appropriate Java IDE or - build environment must be installed. +Maven artifact **`au.gov.nehta:common-library`** - shared Java utility classes for CDA package operations, argument validation, and web-service helpers used by other ADHA/NEHTA libraries. -- Java source files can be found in: - common-library-java--sources.jar +## Dependency -- For detailed API documentation, refer to the included Javadoc package. +Published releases are consumed from **[Maven Central](https://central.sonatype.com/)**. Use a **``** that matches your JDK (see **Versioning**). -Solution -===== +```xml + + au.gov.nehta + common-library + 11.0.0 + +``` -The package consists of these components: +**This line (`11.0.0`):** Java **11**, **Jakarta** XML APIs via **`jaxws-rt` 4.0.5**. - - /common-library-java-.jar - Contains the required classes for package operations. +--- - - /common-library-java--docs.jar - Contains Javadoc documentation. +## Versioning - - /common-library-java--sources.jar - Contains library source files. +The **first number** of the Maven version is the **Java SE** version that this library targets. -Pre-Requisites -===== +| Maven version | Java SE | XML stack | +| ------------- | ------- | --------- | +| **8.0.0** | **8** | **`javax.*`** / EE4J **`jaxws-rt` 2.3.x** at runtime in consumers | +| **11.0.0** | **11** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | +| **17.0.0.1** | **17** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | +| **21.0.0.1** | **21** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | +| **24.0.0.1** | **24** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | -Java Development Kit (JDK) ------ -Follow the usual instructions for installing a JDK, or the instructions below. +Pick the coordinate that matches your JDK. All published versions are on **[Maven Central](https://central.sonatype.com/)**. - 1. Download and install JDK 8 Update 271 or later: +--- - URL: https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html +## Local development (SNAPSHOT) - 2. Unpack the JDK distribution into a directory of your choice. +This repository builds **`11.0.0-SNAPSHOT`**. To make an unpublished JAR resolvable for other local projects: - This directory will be your and will be used in this document - to refer to the root directory of the JDK installation. +```text +mvn -B "-Dgpg.skip=true" clean install +``` - will be used in this document to refer to /jre. +If Maven warns that a **GA** POM is missing, clear stale **`au/gov/nehta/common-library`** entries in your local Maven repository (folders with only **`.lastUpdated`** files) and reinstall the SNAPSHOT. - 3. Create a JAVA_HOME environment variable pointing to the - directory in Step 2. +## Building from source - 4. Add /bin to the system path. +**Audience:** contributors changing this repository - not integrators adding a Maven dependency. -Licensing -===== -Copyright 2012 NEHTA +Prerequisites: **JDK 11+**, **Maven 3.6+**. -Copyright 2021 ADHA +```text +mvn -B "-Dgpg.skip=true" clean verify +``` -Licensed under the NEHTA/ADHA Open Source (Apache) License; you may not use this -file except in compliance with the License. A copy of the License is in the -'LICENSE.txt' file, which should be provided with this work. +See **`CONTRIBUTING.md`** for **`mvn install`** when testing unpublished snapshots locally. -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -License for the specific language governing permissions and limitations -under the License. +## Related repositories + +| Repository | Role | +| ---------- | ---- | +| [hi-b2b-client-java](https://github.com/AuDigitalHealth/hi-b2b-client-java) | HI facade clients (depends on this artifact) | +| [mhr-b2b-client-java](https://github.com/AuDigitalHealth/mhr-b2b-client-java) | MHR facades (depends on this artifact) | + +## Documentation + +| Document | Audience | +| -------- | -------- | +| **README.md** (this file) | Integrators | +| **CONTRIBUTING.md** | Contributors | +| **MAINTAINERS.md** | Releases and tooling | +| **SECURITY.md** | Secrets and credentials | +| **CHANGELOG.md** | Release history | +| **LICENSE.txt** | Apache License 2.0 + ADHA terms | + +## License + +Apache License 2.0. See **LICENSE.txt**. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..dde28d9 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,12 @@ +# Security + +## Reporting issues + +Report security-sensitive findings through your organisation's usual channel for **ADHA / AuDigitalHealth** repositories (do not open a public issue with exploit details before it is triaged). + +## This repository + +- **Do not commit secrets to git.** That includes passwords, API tokens, private keys, real mutual-TLS keystores, production or staging endpoint URLs with embedded credentials, and Services Australia / vendor registration material - even inside comments, test fixtures, or tracked documentation. +- **`local.properties`** is gitignored. Never commit real credentials or keystores. +- **`settings.xml`** at the repository root is gitignored when it contains release credentials; do not commit populated copies. Use **`settings.xml.example`** as the template (server id **`central`**). +- In property files, prefer **forward slashes** in filesystem paths so the same values work on **Windows**, **macOS**, and **Linux**. diff --git a/pom.xml b/pom.xml index af683d9..08464e4 100644 --- a/pom.xml +++ b/pom.xml @@ -2,14 +2,14 @@ 4.0.0 au.gov.nehta common-library - 1.2.3-SNAPSHOT + 11.0.0-SNAPSHOT ADHA/NEHTA Common Library Java classes for common code used by other ADHA/NEHTA libraries https://github.com/AuDigitalHealth/common-library-java @@ -65,7 +65,7 @@ - 8 + 11 UTF-8 ${encoding} ${encoding} @@ -84,28 +84,30 @@ true true [maven-release-plugin] - - 2.3.7 + + 4.0.5 + 4.0.5 + 4.0.3 + 3.0.2 4.13.2 3.5.0 3.15.0 - 3.5.5 + 3.5.6 3.12.0 3.4.0 3.1.4 3.3.1 - 0.9.0 + 0.11.0 3.6.1 3.2.8 - 0.8.14 - 1.2.1 + 3.6.2 + 0.8.15 + + ${project.version} 3.6.2 - - ${project.version} 3.5.0 -Xmx1024m - @@ -115,33 +117,29 @@ ${ee4j.jaxws.version} - au.gov.nehta - smi-xsp - ${nehta.xsp.lib.version} + jakarta.xml.bind + jakarta.xml.bind-api + ${jakarta.xml.bind.api.version} - - junit - junit - ${junit.version} - test + jakarta.xml.ws + jakarta.xml.ws-api + ${jakarta.xml.ws.api.version} - org.apache.santuario - xmlsec - 2.2.1 - test + jakarta.xml.soap + jakarta.xml.soap-api + ${jakarta.xml.soap.api.version} - org.slf4j - slf4j-api - 1.7.7 - test + au.gov.nehta + smi-xsp + ${nehta.xsp.lib.version} - org.slf4j - slf4j-simple - 1.7.30 + junit + junit + ${junit.version} test @@ -158,6 +156,39 @@ true + + org.apache.maven.plugins + maven-enforcer-plugin + ${plugin.enforcer.version} + + + enforce-build-tooling + validate + + enforce + + + + + [3.6.3,) + + + + com.sun.xml.ws:webservices-rt + com.sun.xml.ws:webservices-api + com.sun.xml.ws:webservices-extra + com.sun.xml.ws:webservices-extra-api + javax.xml.ws:* + javax.xml.bind:* + javax.xml.soap:* + + Use Eclipse EE4J jaxws-rt and Jakarta XML APIs, not legacy Metro / javax JAX-WS, JAXB, or SOAP APIs. + + + + + + org.apache.maven.plugins maven-gpg-plugin @@ -184,7 +215,7 @@ none false ${encoding} - 8 + 11 @@ -239,10 +270,7 @@ - **/TimeUtilityTest.java - **/TestConfigurationTest.java - **/HiWsdlArtifactRootTest.java - **/ConsumerSearchIHIClientArgumentValidatorTest.java + **/*Test.java diff --git a/settings.xml.example b/settings.xml.example new file mode 100644 index 0000000..fee3e9f --- /dev/null +++ b/settings.xml.example @@ -0,0 +1,28 @@ + + + + + diff --git a/src/main/java/au/gov/nehta/vendorlibrary/common/DOMUtil.java b/src/main/java/au/gov/nehta/vendorlibrary/common/DOMUtil.java index ef9fdce..65cfcdf 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/common/DOMUtil.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/common/DOMUtil.java @@ -20,7 +20,7 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/common/JAXBUtil.java b/src/main/java/au/gov/nehta/vendorlibrary/common/JAXBUtil.java index f960553..c4fcc31 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/common/JAXBUtil.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/common/JAXBUtil.java @@ -18,8 +18,8 @@ import org.w3c.dom.Document; import javax.xml.XMLConstants; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBElement; +import jakarta.xml.bind.JAXBException; import javax.xml.namespace.QName; import javax.xml.transform.TransformerException; import java.io.ByteArrayInputStream; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/ws/TimeUtility.java b/src/main/java/au/gov/nehta/vendorlibrary/ws/TimeUtility.java index b45bc67..2059bca 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/ws/TimeUtility.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/ws/TimeUtility.java @@ -17,9 +17,12 @@ import javax.xml.datatype.DatatypeConstants; import javax.xml.datatype.DatatypeFactory; import javax.xml.datatype.XMLGregorianCalendar; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Calendar; +import java.time.DateTimeException; +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; import java.util.Date; import java.util.GregorianCalendar; import java.util.logging.Level; @@ -63,18 +66,14 @@ public final class TimeUtility { */ public static final int DATE_TIME_LENGTH = COMPACT_DATE_TIME_FORMAT.length(); + private static final DateTimeFormatter FORMATTER_NOW = DateTimeFormatter.ofPattern(DATE_FORMAT_NOW); + + private static final DateTimeFormatter FORMATTER_DATE = DateTimeFormatter.ofPattern(DATE_FORMAT); - /** - * Logger instance for event/error logging. - */ private static final Logger LOGGER = Logger.getLogger(TimeUtility.class .getName()); - /** - * Default private constructor for Utility class. - */ private TimeUtility() { - } /** @@ -83,36 +82,24 @@ private TimeUtility() { * * @param date as string in yyyyMMdd HH:mm:ss format * @return date as XMLGregorianCalendar instance. Returns null in an event - * of error. Invoking method must check for null. + * of error. Invoking method must check for null. */ public static XMLGregorianCalendar getXMLGregorianDateTime( final String date) { try { if (date.matches(DATE_FORMAT_NOW_REGX)) { + LocalDateTime dateTime = LocalDateTime.parse(date, FORMATTER_NOW); XMLGregorianCalendar cal = DatatypeFactory.newInstance() .newXMLGregorianCalendar(new GregorianCalendar()); - SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT_NOW); - String pattern = format.toPattern(); - Date simpleDate = format.parse(date); - Calendar calendar = Calendar.getInstance(); - calendar.setTime(simpleDate); - - int year = calendar.get(Calendar.YEAR); - int month = calendar.get(Calendar.MONTH); - int day = calendar.get(Calendar.DAY_OF_MONTH); - int hour = calendar.get(Calendar.HOUR_OF_DAY); - int min = calendar.get(Calendar.MINUTE); - int second = calendar.get(Calendar.SECOND); - - cal.setDay(day); - cal.setYear(year); - cal.setMonth(month); - cal.setHour(hour); - cal.setMinute(min); - cal.setSecond(second); + cal.setYear(dateTime.getYear()); + cal.setMonth(dateTime.getMonthValue()); + cal.setDay(dateTime.getDayOfMonth()); + cal.setHour(dateTime.getHour()); + cal.setMinute(dateTime.getMinute()); + cal.setSecond(dateTime.getSecond()); return cal; } - } catch (DatatypeConfigurationException | ParseException ex) { + } catch (DatatypeConfigurationException | DateTimeException ex) { throw new IllegalArgumentException("Incorrect date format" + date + ". Must be set in " + DATE_FORMAT + " format", ex); } @@ -127,35 +114,21 @@ public static XMLGregorianCalendar getXMLGregorianDateTime( * * @param date in yyyymmdd format * @return XMLGregorianCalendar date. Return null in an event of error. - * Invoking method must check for null. + * Invoking method must check for null. */ public static XMLGregorianCalendar getXMLGregorianDate(final String date) { try { - XMLGregorianCalendar cal = DatatypeFactory.newInstance() - .newXMLGregorianCalendar(new GregorianCalendar()); if (date.matches(DATE_FORMAT_REGX)) { - - SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT); - Calendar calendar = Calendar.getInstance(); - - Date simpleDate = format.parse(date); - - calendar.setTime(simpleDate); - - int year = calendar.get(Calendar.YEAR); - int month = calendar.get(Calendar.MONTH); - int day = calendar.get(Calendar.DAY_OF_MONTH); - - cal.setDay(day); - cal.setYear(year); - //Month is zero based in Date and one based in Calendar - cal.setMonth(month + 1); - - // Unset the timezone. + LocalDate localDate = LocalDate.parse(date, FORMATTER_DATE); + XMLGregorianCalendar cal = DatatypeFactory.newInstance() + .newXMLGregorianCalendar(new GregorianCalendar()); + cal.setYear(localDate.getYear()); + cal.setMonth(localDate.getMonthValue()); + cal.setDay(localDate.getDayOfMonth()); cal.setTimezone(DatatypeConstants.FIELD_UNDEFINED); return cal; } - } catch (ParseException | DatatypeConfigurationException ex) { + } catch (DatatypeConfigurationException | DateTimeException ex) { throw new IllegalArgumentException("Incorrect date format" + date + ". Must be set in " + DATE_FORMAT + " format", ex); } @@ -169,10 +142,7 @@ public static XMLGregorianCalendar getXMLGregorianDate(final String date) { * @return the current system time. */ public static String now() { - Calendar cal = Calendar.getInstance(); - SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); - return sdf.format(cal.getTime()); - + return LocalDateTime.now().format(FORMATTER_NOW); } /** @@ -181,8 +151,7 @@ public static String now() { * @return current dateTime as {@link java.util.Date} */ public static Date nowDate() { - Calendar cal = Calendar.getInstance(); - return cal.getTime(); + return Date.from(Instant.now()); } /** @@ -192,13 +161,13 @@ public static Date nowDate() { * @return the date in YYYYMMDD format. */ public static String getDateAsYYYYMMDD(final Date date) { - String dateTime = null; - if (date != null) { - SimpleDateFormat dateformatYYYYMMDD = new SimpleDateFormat( - TimeUtility.DATE_FORMAT); - dateTime = dateformatYYYYMMDD.format(date); + if (date == null) { + return null; } - return dateTime; + return Instant.ofEpochMilli(date.getTime()) + .atZone(ZoneId.systemDefault()) + .toLocalDate() + .format(FORMATTER_DATE); } /** diff --git a/src/main/java/au/gov/nehta/vendorlibrary/ws/WebServiceClientUtil.java b/src/main/java/au/gov/nehta/vendorlibrary/ws/WebServiceClientUtil.java index e1e87dd..6a43a14 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/ws/WebServiceClientUtil.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/ws/WebServiceClientUtil.java @@ -15,11 +15,11 @@ import javax.net.SocketFactory; import javax.xml.namespace.QName; -import javax.xml.ws.BindingProvider; -import javax.xml.ws.Service; -import javax.xml.ws.WebServiceClient; -import javax.xml.ws.handler.Handler; -import javax.xml.ws.soap.AddressingFeature; +import jakarta.xml.ws.BindingProvider; +import jakarta.xml.ws.Service; +import jakarta.xml.ws.WebServiceClient; +import jakarta.xml.ws.handler.Handler; +import jakarta.xml.ws.soap.AddressingFeature; import java.net.URL; import java.util.List; import java.util.Map; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/ws/handler/LoggingHandler.java b/src/main/java/au/gov/nehta/vendorlibrary/ws/handler/LoggingHandler.java index 7b547f3..b5841e6 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/ws/handler/LoggingHandler.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/ws/handler/LoggingHandler.java @@ -21,7 +21,7 @@ import javax.xml.namespace.QName; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; -import javax.xml.ws.handler.MessageContext; +import jakarta.xml.ws.handler.MessageContext; import java.io.ByteArrayOutputStream; import java.util.Set; import java.util.logging.Logger; @@ -95,7 +95,7 @@ public String getLastSoapRequest() { * @param context The SOAP Message context. * @return {@link Boolean}.TRUE handle message is successful else return * FALSE - * @see javax.xml.ws.handler.Handler#handleMessage(javax.xml.ws.handler.MessageContext) + * @see jakarta.xml.ws.handler.Handler#handleMessage(jakarta.xml.ws.handler.MessageContext) */ public boolean handleMessage(final MessageHandlerContext context) { // log SOAP message to console @@ -110,7 +110,7 @@ public boolean handleMessage(final MessageHandlerContext context) { * response * @return {@link Boolean}.TRUE if handleFault is successful, else returns * {@link Boolean}.FALSE - * @see javax.xml.ws.handler.Handler#handleFault(javax.xml.ws.handler.MessageContext) + * @see jakarta.xml.ws.handler.Handler#handleFault(jakarta.xml.ws.handler.MessageContext) */ public boolean handleFault(final MessageHandlerContext context) { // log SOAP message to console @@ -164,7 +164,7 @@ private String getSoapAsString(MessageHandlerContext mhc) { * 'Dump' the SOAP message. * * @return Set the headers for this handler. - * @see javax.xml.ws.handler.soap.SOAPHandler#getHeaders() + * @see jakarta.xml.ws.handler.soap.SOAPHandler#getHeaders() */ public Set getHeaders() { return null; @@ -175,7 +175,7 @@ public Set getHeaders() { * Not utilised for dumping SOAP message. * * @param context the SOAP Message context - * @see javax.xml.ws.handler.Handler#close(javax.xml.ws.handler.MessageContext) + * @see jakarta.xml.ws.handler.Handler#close(jakarta.xml.ws.handler.MessageContext) */ public void close(final MessageContext context) { } diff --git a/src/main/java/au/gov/nehta/vendorlibrary/xml/XmlUtil.java b/src/main/java/au/gov/nehta/vendorlibrary/xml/XmlUtil.java index 0b65cac..255b2e4 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/xml/XmlUtil.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/xml/XmlUtil.java @@ -15,10 +15,10 @@ import org.w3c.dom.Node; -import javax.xml.soap.SOAPEnvelope; -import javax.xml.soap.SOAPException; -import javax.xml.soap.SOAPMessage; -import javax.xml.soap.SOAPPart; +import jakarta.xml.soap.SOAPEnvelope; +import jakarta.xml.soap.SOAPException; +import jakarta.xml.soap.SOAPMessage; +import jakarta.xml.soap.SOAPPart; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; diff --git a/src/main/java/au/gov/nehta/vendorlibrary/xml/_XmlUtil.java b/src/main/java/au/gov/nehta/vendorlibrary/xml/_XmlUtil.java index 38ab904..5110cca 100644 --- a/src/main/java/au/gov/nehta/vendorlibrary/xml/_XmlUtil.java +++ b/src/main/java/au/gov/nehta/vendorlibrary/xml/_XmlUtil.java @@ -17,7 +17,7 @@ import java.util.logging.Level; import java.util.logging.Logger; -import javax.xml.soap.SOAPMessage; +import jakarta.xml.soap.SOAPMessage; /** * A helper class to obtain easy-to-read XML from SOAPMessage objects. diff --git a/src/test/java/au/gov/nehta/vendorlibrary/common/security/KeystoreUtilTest.java b/src/test/java/au/gov/nehta/vendorlibrary/common/security/KeystoreUtilTest.java index 40830e9..c2e4604 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/common/security/KeystoreUtilTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/common/security/KeystoreUtilTest.java @@ -17,134 +17,125 @@ import au.gov.nehta.vendorlibrary.common.TestConstant; import org.junit.Test; -import org.junit.experimental.theories.Theories; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.Principal; -import java.security.PrivateKey; import java.security.cert.CertificateParsingException; import java.security.cert.X509Certificate; import java.util.Collection; -import java.util.Enumeration; +import java.util.Collections; import java.util.Iterator; import java.util.List; public class KeystoreUtilTest { @Test - public void testSubjectAltenativeNameForCertificates() throws Exception{ + public void testSubjectAltenativeNameForCertificates() throws Exception { - X509Certificate x509Certificate = TestConstant.getSigningCertificate(TestConstant.MEDICARE_CURRENT_PRIVATE_KEY_ALIAS); - Collection altNames=null; - Collection issuerAltNames=null; - issuerAltNames= x509Certificate.getIssuerAlternativeNames(); + X509Certificate x509Certificate = TestConstant + .getSigningCertificate(TestConstant.MEDICARE_CURRENT_PRIVATE_KEY_ALIAS); + Collection altNames = null; + Collection issuerAltNames = null; + issuerAltNames = x509Certificate.getIssuerAlternativeNames(); - Principal princple = x509Certificate.getSubjectDN(); + Principal princple = x509Certificate.getSubjectX500Principal(); princple.getName(); - System.out.println("The subject name is "+ princple.getName()); + System.out.println("The subject name is " + princple.getName()); String[] subjectContents = princple.getName().split(", "); - String subjectKey="CN="; - for(String uniqueId: subjectContents){ - if(uniqueId.indexOf(subjectKey)>=0){ + String subjectKey = "CN="; + for (String uniqueId : subjectContents) { + if (uniqueId.indexOf(subjectKey) >= 0) { System.out.println("the CN name is " + uniqueId.substring((uniqueId.lastIndexOf("=") + 1))); } } - altNames = x509Certificate.getSubjectAlternativeNames(); - //populate alternativeNames - if(altNames!= null){ - Iterator itAltNames = altNames.iterator(); - while(itAltNames.hasNext()){ - List extensionEntry = (List)itAltNames.next(); + altNames = x509Certificate.getSubjectAlternativeNames(); + // populate alternativeNames + if (altNames != null) { + Iterator itAltNames = altNames.iterator(); + while (itAltNames.hasNext()) { + List extensionEntry = (List) itAltNames.next(); Integer nameType = (Integer) extensionEntry.get(0); String name = (String) extensionEntry.get(1); - System.out.println("The name is "+ name); + System.out.println("The name is " + name); } } - if(issuerAltNames!= null){ - Iterator issuerAltNamesItr = issuerAltNames.iterator(); - while(issuerAltNamesItr.hasNext()){ - List extensionEntry = (List)issuerAltNamesItr.next(); + if (issuerAltNames != null) { + Iterator issuerAltNamesItr = issuerAltNames.iterator(); + while (issuerAltNamesItr.hasNext()) { + List extensionEntry = (List) issuerAltNamesItr.next(); Integer nameType = (Integer) extensionEntry.get(0); String name = (String) extensionEntry.get(1); - System.out.println("The name is "+ name); + System.out.println("The name is " + name); } } } - @Test - public void testSubjectAlternativeNameForMedicareNewCertificates() throws Exception{ + public void testSubjectAlternativeNameForMedicareNewCertificates() throws Exception { X509Certificate x509Certificate = TestConstant.getSigningCertificate(TestConstant.MEDICARE_NEW_PRIVATE_KEY_ALIAS); - Collection altNames=null; - Collection issuerAltNames=null; - issuerAltNames= x509Certificate.getIssuerAlternativeNames(); + Collection altNames = null; + Collection issuerAltNames = null; + issuerAltNames = x509Certificate.getIssuerAlternativeNames(); - Principal princple = x509Certificate.getSubjectDN(); + Principal princple = x509Certificate.getSubjectX500Principal(); princple.getName(); - System.out.println("The subject name is "+ princple.getName()); + System.out.println("The subject name is " + princple.getName()); String[] subjectContents = princple.getName().split(", "); - String subjectKey="CN="; - for(String uniqueId: subjectContents){ - if(uniqueId.indexOf(subjectKey)>=0){ - System.out.println("the CN name is "+uniqueId.substring((uniqueId.lastIndexOf("=")+1))); + String subjectKey = "CN="; + for (String uniqueId : subjectContents) { + if (uniqueId.indexOf(subjectKey) >= 0) { + System.out.println("the CN name is " + uniqueId.substring((uniqueId.lastIndexOf("=") + 1))); } } - altNames = x509Certificate.getSubjectAlternativeNames(); - //populate alternativeNames - if(altNames!= null){ - Iterator itAltNames = altNames.iterator(); - while(itAltNames.hasNext()){ - List extensionEntry = (List)itAltNames.next(); + altNames = x509Certificate.getSubjectAlternativeNames(); + // populate alternativeNames + if (altNames != null) { + Iterator itAltNames = altNames.iterator(); + while (itAltNames.hasNext()) { + List extensionEntry = (List) itAltNames.next(); Integer nameType = (Integer) extensionEntry.get(0); String name = (String) extensionEntry.get(1); - System.out.println("The name is "+ name); + System.out.println("The name is " + name); } } - if(issuerAltNames!= null){ - Iterator issuerAltNamesItr = issuerAltNames.iterator(); - while(issuerAltNamesItr.hasNext()){ - List extensionEntry = (List)issuerAltNamesItr.next(); + if (issuerAltNames != null) { + Iterator issuerAltNamesItr = issuerAltNames.iterator(); + while (issuerAltNamesItr.hasNext()) { + List extensionEntry = (List) issuerAltNamesItr.next(); Integer nameType = (Integer) extensionEntry.get(0); String name = (String) extensionEntry.get(1); - System.out.println("The name is "+ name); + System.out.println("The name is " + name); } } } - //URN:NEHTA:HPI-O:8003622345681622 - - private void getKeystore(KeyStore keyStore, String saName) throws KeyStoreException, CertificateParsingException { - Enumeration aliases = keyStore.aliases(); + // URN:NEHTA:HPI-O:8003622345681622 - Collection altNames=null; - - while(aliases.hasMoreElements()) - { - String alias = aliases.nextElement(); + private void getKeystore(KeyStore keyStore, String saName) throws KeyStoreException, CertificateParsingException { + for (String alias : Collections.list(keyStore.aliases())) { X509Certificate certificate = (X509Certificate) keyStore.getCertificate(alias); - altNames = certificate.getSubjectAlternativeNames(); - //populate alternativeNames - if(altNames!= null){ - Iterator itAltNames = altNames.iterator(); - while(itAltNames.hasNext()){ - List extensionEntry = (List)itAltNames.next(); + Collection altNames = certificate.getSubjectAlternativeNames(); + // populate alternativeNames + if (altNames != null) { + Iterator itAltNames = altNames.iterator(); + while (itAltNames.hasNext()) { + List extensionEntry = (List) itAltNames.next(); Integer nameType = (Integer) extensionEntry.get(0); String name = (String) extensionEntry.get(1); - if(name.equals(saName)) - { - System.out.println("the name matched "+ name); + if (name.equals(saName)) { + System.out.println("the name matched " + name); } } @@ -155,12 +146,11 @@ private void getKeystore(KeyStore keyStore, String saName) throws KeyStoreExcep } @Test - public void testGetCertificatesByAlternativeNames() throws Exception{ + public void testGetCertificatesByAlternativeNames() throws Exception { KeyStore keyStore = KeystoreUtil.loadKeyStore(PRIVATE_KEY_STORE_TYPE, PRIVATE_KEY_STORE_PASSWORD, - PRIVATE_KEY_STORE_FILE); + PRIVATE_KEY_STORE_FILE); String subjectAlternateName = "URN:NEHTA:HPI-O:8003622345681622"; - getKeystore(keyStore,subjectAlternateName); + getKeystore(keyStore, subjectAlternateName); } - } diff --git a/src/test/java/au/gov/nehta/vendorlibrary/ws/TimeUtilityTest.java b/src/test/java/au/gov/nehta/vendorlibrary/ws/TimeUtilityTest.java index ce705a1..380c55b 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/ws/TimeUtilityTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/ws/TimeUtilityTest.java @@ -17,7 +17,9 @@ import javax.xml.datatype.XMLGregorianCalendar; -import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; import java.util.Date; import static org.junit.Assert.*; @@ -61,6 +63,12 @@ public void testGetXMLGregorianDateTime() throws Exception { XMLGregorianCalendar calendar = TimeUtility.getXMLGregorianDateTime(date); assertNotNull(calendar); assertTrue(calendar.isValid()); + assertEquals(2007, calendar.getYear()); + assertEquals(8, calendar.getMonth()); + assertEquals(4, calendar.getDay()); + assertEquals(18, calendar.getHour()); + assertEquals(1, calendar.getMinute()); + assertEquals(1, calendar.getSecond()); } @@ -87,8 +95,10 @@ public void testDateRegularExpressionGregorianDate() throws Exception { @Test public void testGetDateAsYYYYMMDD() throws Exception { Date date = new Date(); - SimpleDateFormat dateformatYYYYMMDD = new SimpleDateFormat(TimeUtility.DATE_FORMAT); - String expectedDate = new String( dateformatYYYYMMDD.format( date ) ); + String expectedDate = Instant.ofEpochMilli(date.getTime()) + .atZone(ZoneId.systemDefault()) + .toLocalDate() + .format(DateTimeFormatter.ofPattern(TimeUtility.DATE_FORMAT)); String actualDate = TimeUtility.getDateAsYYYYMMDD(date); assertNotNull(actualDate); assertEquals(expectedDate, actualDate); From 8cec35e4c952054795eb017da29cc011bac5329e Mon Sep 17 00:00:00 2001 From: Gavin Baumanis Date: Tue, 25 Aug 2026 23:26:44 +1000 Subject: [PATCH 2/4] Release 17.0.0: Java 17 / Jakarta. Uplift the 11.0.0 line to 17.0.0-SNAPSHOT with maven.compiler.release 17, sibling au.gov.nehta deps at , current stable Jakarta/EE4J stack, and docs/CI for the java-17 public line. --- .cursor/rules/common-library-project.mdc | 10 ++--- .github/workflows/ci.yml | 23 ++++++++++ CHANGELOG.md | 11 ++++- CONTRIBUTING.md | 6 +-- MAINTAINERS.md | 23 +++++----- README.md | 10 ++--- SECURITY.md | 8 ++++ pom.xml | 26 +++++++---- .../vendorlibrary/common/ReleaseLineTest.java | 43 +++++++++++++++++++ 9 files changed, 127 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java diff --git a/.cursor/rules/common-library-project.mdc b/.cursor/rules/common-library-project.mdc index 329c85c..f251092 100644 --- a/.cursor/rules/common-library-project.mdc +++ b/.cursor/rules/common-library-project.mdc @@ -17,7 +17,7 @@ The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** tar | ------------ | ---- | ----------- | | **8.0.0** | 8 | **javax** | | **11.0.0** | 11 | **Jakarta** | -| **17.0.0.1** | 17 | **Jakarta** | +| **17.0.0** | 17 | **Jakarta** | | **21.0.0.1** | 21 | **Jakarta** | | **24.0.0.1** | 24 | **Jakarta** | @@ -27,17 +27,17 @@ The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** tar | ------------ | ------------------- | | **8.0.0** | `java-8` | | **11.0.0** | `java-11` | -| **17.0.0.1** | `java-17` | +| **17.0.0** | `java-17` | | **21.0.0.1** | `java-21` | | **24.0.0.1** | `java-24` | -## This 11.0.0 line +## This 17.0.0 line -**`11.0.0-SNAPSHOT`**: Java **11**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. +**`17.0.0-SNAPSHOT`**: Java **17**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. Siblings **`smi-common-utils`** and **`smi-xsp`** at **`${project.version}`**. ## Build -- JDK **11+**, from repo root: `mvn -B "-Dgpg.skip=true" clean verify` (quote `-D` on PowerShell). +- JDK **17+**, from repo root: `mvn -B "-Dgpg.skip=true" clean verify` (quote `-D` on PowerShell). ## Doc split diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1b09531 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: + push: + branches: [ java-17 ] + pull_request: + branches: [ java-17 ] + +permissions: + contents: read + +jobs: + verify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: "17" + cache: maven + - name: Maven verify + run: mvn -B "-Dgpg.skip=true" clean verify diff --git a/CHANGELOG.md b/CHANGELOG.md index de56e4e..6ebf8e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,19 @@ # Change Log/Revision History +# = 17.0.0 = + +- Maven **`au.gov.nehta:common-library`** **17.0.0** (Java **17** / **Jakarta**). +- POM: **`maven.compiler.release` 17**; Jakarta XML APIs, **`jaxws-rt` 4.0.5**. +- Sibling **`smi-xsp`** and **`smi-common-utils`** at **`${project.version}`** (**17.0.0**). +- Enforcer requires JDK **17+**; **`maven-enforcer-plugin` 3.6.3**. +- No unused direct **`xmlsec`** / **`slf4j`** declarations (arrive via siblings / runtime as needed). +- **`smi-common-utils`** supplies **`JaxbUtils`** after **`smi-xsp`** dropped its unused copy. + # = 11.0.0 = - Maven **`au.gov.nehta:common-library`** **11.0.0** (Java **11** / **Jakarta**). - POM: Jakarta XML APIs, **`jaxws-rt` 4.0.5**; declare bind/ws/soap APIs used by sources. -- **`smi-xsp`** at **`nehta.xsp.lib.version`** = **`${project.version}`** (**11.0.0**). +- **`smi-xsp`** at **`${project.version}`** (**11.0.0**). - `TimeUtility` uses `java.time` (`DateTimeFormatter` / `LocalDateTime`) instead of `SimpleDateFormat`. - Drop unused test-only `xmlsec` / `slf4j` declarations (arrive via `smi-xsp` / runtime as needed). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 10c276e..be27036 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,14 +4,14 @@ ## Prerequisites -- **JDK 11+** with **`JAVA_HOME`** set (see **`maven.compiler.release`** in **`pom.xml`**). +- **JDK 17+** with **`JAVA_HOME`** set (see **`maven.compiler.release`** in **`pom.xml`**). - **Maven 3.6+** on **`PATH`**. Dependencies resolve from **[Maven Central](https://central.sonatype.com/)** unless you are installing a **local SNAPSHOT** (below). This POM has no sibling Maven modules. ## Versioning -The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** version that this library targets. **11.0.0** targets Java **11** / **Jakarta**; **8.0.0** uses **`javax`**. See **`README.md`**. +The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** version that this library targets. **17.0.0** targets Java **17** / **Jakarta**; **11.0.0** targets Java **11** / **Jakarta**; **8.0.0** uses **`javax`**. See **`README.md`**. ## Build @@ -32,7 +32,7 @@ GPG signing is skipped by default (**`-Dgpg.skip=true`**). Release builds: **`-D ## Dependencies - Runtime SOAP stack: **`com.sun.xml.ws:jaxws-rt` 4.0.5** (plus declared Jakarta bind / WS / SOAP APIs). -- Sibling **`au.gov.nehta:smi-xsp`** at the same Maven version (**`${project.version}`**). +- Siblings **`au.gov.nehta:smi-common-utils`** and **`au.gov.nehta:smi-xsp`** at **`${project.version}`**. - Test: **`junit`**. ## Local builds (unpublished artifacts) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 54edf8a..e9ed5c7 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -12,7 +12,7 @@ The **first number** of **``** is the **Java SE** target of **this** li | ------------- | ------- | | **8.0.0** | **8** | | **11.0.0** | **11** | -| **17.0.0.1** | **17** | +| **17.0.0** | **17** | | **21.0.0.1** | **21** | | **24.0.0.1** | **24** | @@ -22,7 +22,7 @@ The **first number** of **``** is the **Java SE** target of **this** li | ------------ | ---- | --------------------------------------------------------------- | | **8.0.0** | 8 | **`javax.xml.ws`**, **`javax.xml.bind`** (via `jaxws-rt` 2.3.7) | | **11.0.0** | 11 | **Jakarta** XML WS / Bind | -| **17.0.0.1** | 17 | **Jakarta** XML WS / Bind | +| **17.0.0** | 17 | **Jakarta** XML WS / Bind | | **21.0.0.1** | 21 | **Jakarta** XML WS / Bind | | **24.0.0.1** | 24 | **Jakarta** XML WS / Bind | @@ -32,15 +32,15 @@ The **first number** of **``** is the **Java SE** target of **this** li | ------------ | ------------------- | | **8.0.0** | `java-8` | | **11.0.0** | `java-11` | -| **17.0.0.1** | `java-17` | +| **17.0.0** | `java-17` | | **21.0.0.1** | `java-21` | | **24.0.0.1** | `java-24` | Artifact id stays **`common-library`**; the version distinguishes the Java SE line. -On a given branch, **do not change the first number** of **``**. Next GA on **`java-11`** is **`11.0.0.2`** (then **`11.0.1-SNAPSHOT`**), not a different first number. A new Java SE target is a **new branch**, not a bump on this one. +On a given branch, **do not change the first number** of **``**. Next GA on **`java-17`** is **`17.0.0.1`** (then **`17.0.1-SNAPSHOT`**), not a different first number. A new Java SE target is a **new branch**, not a bump on this one. -**This checkout (`11.0.0-SNAPSHOT`):** Java **11**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. +**This checkout (`17.0.0-SNAPSHOT`):** Java **17**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. ## Artifact @@ -60,11 +60,11 @@ Publishing uses **`central-publishing-maven-plugin`** (Sonatype Central Portal). | ------------- | ------------ | ---------------- | | **`java-8`** | 8 / javax | **8.0.0** | | **`java-11`** | 11 / Jakarta | **11.0.0** | -| **`java-17`** | 17 / Jakarta | **17.0.0.1** | +| **`java-17`** | 17 / Jakarta | **17.0.0** | | **`java-21`** | 21 / Jakarta | **21.0.0.1** | | **`java-24`** | 24 / Jakarta | **24.0.0.1** | -**`-DdevelopmentVersion`:** keep the same first number as **`-DreleaseVersion`** (example on this line: **`11.0.0`** then **`11.0.1-SNAPSHOT`**). +**`-DdevelopmentVersion`:** keep the same first number as **`-DreleaseVersion`** (example on this line: **`17.0.0`** then **`17.0.1-SNAPSHOT`**). ### SNAPSHOT or manual GA @@ -72,14 +72,14 @@ Publishing uses **`central-publishing-maven-plugin`** (Sonatype Central Portal). 2. **`mvn -B "-Prelease" clean verify`** 3. **`mvn -B "-Prelease" deploy`** -Tags default to **`{artifactId}-{version}`** (e.g. **`common-library-11.0.0`**). +Tags default to **`{artifactId}-{version}`** (e.g. **`common-library-17.0.0`**). ### Automated GA (`maven-release-plugin`) Run on the **target branch** with a **clean** working tree. ```text -mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=11.0.0 -DdevelopmentVersion=11.0.1-SNAPSHOT -Dtag=common-library-11.0.0 +mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=17.0.0 -DdevelopmentVersion=17.0.1-SNAPSHOT -Dtag=common-library-17.0.0 ``` **After success:** confirm **`common-library`** GA on Central before cutting downstream GAs. @@ -92,10 +92,11 @@ mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=11.0.0 -Ddev When adding a line (e.g. Java **25**): create **`java-25`** in **this** repository from the nearest existing line; set **``** first number to **25** (e.g. **`25.0.0.1-SNAPSHOT`**); set **`maven.compiler.release`**, Jakarta coordinates, CI **`java-version`** / branch filter, and docs to that line. Do not retarget an existing branch. -## Build (`11.0.0` line) +## Build (`17.0.0` line) -- **`maven.compiler.release` 11** +- **`maven.compiler.release` 17** - Runtime SOAP stack: **`com.sun.xml.ws:jaxws-rt` 4.0.5** in **consuming** applications +- Sibling **`au.gov.nehta:smi-common-utils`** and **`au.gov.nehta:smi-xsp`**: **`${project.version}`** - **`maven-gpg-plugin`:** skipped unless **`-Dgpg.skip=false`** ## Copyright diff --git a/README.md b/README.md index e2a430a..039a82c 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ Published releases are consumed from **[Maven Central](https://central.sonatype. au.gov.nehta common-library - 11.0.0 + 17.0.0 ``` -**This line (`11.0.0`):** Java **11**, **Jakarta** XML APIs via **`jaxws-rt` 4.0.5**. +**This line (`17.0.0`):** Java **17**, **Jakarta** XML APIs via **`jaxws-rt` 4.0.5**. --- @@ -26,7 +26,7 @@ The **first number** of the Maven version is the **Java SE** version that this l | ------------- | ------- | --------- | | **8.0.0** | **8** | **`javax.*`** / EE4J **`jaxws-rt` 2.3.x** at runtime in consumers | | **11.0.0** | **11** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | -| **17.0.0.1** | **17** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | +| **17.0.0** | **17** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | | **21.0.0.1** | **21** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | | **24.0.0.1** | **24** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | @@ -36,7 +36,7 @@ Pick the coordinate that matches your JDK. All published versions are on **[Mave ## Local development (SNAPSHOT) -This repository builds **`11.0.0-SNAPSHOT`**. To make an unpublished JAR resolvable for other local projects: +This repository builds **`17.0.0-SNAPSHOT`**. To make an unpublished JAR resolvable for other local projects: ```text mvn -B "-Dgpg.skip=true" clean install @@ -48,7 +48,7 @@ If Maven warns that a **GA** POM is missing, clear stale **`au/gov/nehta/common- **Audience:** contributors changing this repository - not integrators adding a Maven dependency. -Prerequisites: **JDK 11+**, **Maven 3.6+**. +Prerequisites: **JDK 17+**, **Maven 3.6+**. ```text mvn -B "-Dgpg.skip=true" clean verify diff --git a/SECURITY.md b/SECURITY.md index dde28d9..0e20621 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,6 +4,14 @@ Report security-sensitive findings through your organisation's usual channel for **ADHA / AuDigitalHealth** repositories (do not open a public issue with exploit details before it is triaged). +## Supported versions + +| Version | Supported | +| -------- | --------- | +| 17.0.0 | Yes | +| 11.0.0 | Yes | +| 8.0.0 | Yes | + ## This repository - **Do not commit secrets to git.** That includes passwords, API tokens, private keys, real mutual-TLS keystores, production or staging endpoint URLs with embedded credentials, and Services Australia / vendor registration material - even inside comments, test fixtures, or tracked documentation. diff --git a/pom.xml b/pom.xml index 08464e4..e97bdae 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ au.gov.nehta common-library - 11.0.0-SNAPSHOT + 17.0.0-SNAPSHOT ADHA/NEHTA Common Library Java classes for common code used by other ADHA/NEHTA libraries https://github.com/AuDigitalHealth/common-library-java @@ -65,7 +65,7 @@ - 11 + 17 UTF-8 ${encoding} ${encoding} @@ -84,7 +84,7 @@ true true [maven-release-plugin] - + 4.0.5 4.0.5 4.0.3 @@ -100,10 +100,8 @@ 0.11.0 3.6.1 3.2.8 - 3.6.2 + 3.6.3 0.8.15 - - ${project.version} 3.6.2 3.5.0 @@ -131,10 +129,15 @@ jakarta.xml.soap-api ${jakarta.xml.soap.api.version} + + au.gov.nehta + smi-common-utils + ${project.version} + au.gov.nehta smi-xsp - ${nehta.xsp.lib.version} + ${project.version} junit @@ -172,6 +175,9 @@ [3.6.3,) + + [17,) + com.sun.xml.ws:webservices-rt @@ -215,7 +221,7 @@ none false ${encoding} - 11 + 17 @@ -268,6 +274,10 @@ fromSurefireEnv + + ${project.version} + ${maven.compiler.release} + **/*Test.java diff --git a/src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java b/src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java new file mode 100644 index 0000000..12a09b9 --- /dev/null +++ b/src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026 ADHA + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. A copy of the License + * is in the LICENSE.txt file at the repository root. + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package au.gov.nehta.vendorlibrary.common; + +import org.junit.Test; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +/** + * Locks this artifact on the Java 17 / 17.0.0 release line. + */ +public class ReleaseLineTest { + + @Test + public void runtimeFeatureIsAtLeast17() { + assertTrue(Runtime.version().feature() >= 17); + } + + @Test + public void mavenCompilerReleaseIs17() { + assertEquals("17", System.getProperty("common.library.compiler.release")); + } + + @Test + public void projectVersionStartsWith17() { + String version = System.getProperty("common.library.project.version"); + assertNotNull(version); + assertTrue(version.startsWith("17.")); + } +} From fffe76d0f16e94728bcb21d5453c126d608e0953 Mon Sep 17 00:00:00 2001 From: Gavin Baumanis Date: Tue, 25 Aug 2026 23:58:04 +1000 Subject: [PATCH 3/4] Release 21.0.0: Java 21 / Jakarta. Uplift the 17.0.0 line to 21.0.0-SNAPSHOT with maven.compiler.release 21, sibling au.gov.nehta deps at ${project.version}, and docs/CI for the java-21 public line. --- .cursor/rules/common-library-project.mdc | 10 ++++----- .github/workflows/ci.yml | 6 ++--- CHANGELOG.md | 8 +++++++ CONTRIBUTING.md | 4 ++-- MAINTAINERS.md | 22 +++++++++---------- README.md | 10 ++++----- SECURITY.md | 1 + pom.xml | 10 ++++----- .../vendorlibrary/common/ReleaseLineTest.java | 14 ++++++------ 9 files changed, 47 insertions(+), 38 deletions(-) diff --git a/.cursor/rules/common-library-project.mdc b/.cursor/rules/common-library-project.mdc index f251092..58b5096 100644 --- a/.cursor/rules/common-library-project.mdc +++ b/.cursor/rules/common-library-project.mdc @@ -18,7 +18,7 @@ The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** tar | **8.0.0** | 8 | **javax** | | **11.0.0** | 11 | **Jakarta** | | **17.0.0** | 17 | **Jakarta** | -| **21.0.0.1** | 21 | **Jakarta** | +| **21.0.0** | 21 | **Jakarta** | | **24.0.0.1** | 24 | **Jakarta** | **Git branch mapping (maintainers only - never in integrator docs):** @@ -28,16 +28,16 @@ The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** tar | **8.0.0** | `java-8` | | **11.0.0** | `java-11` | | **17.0.0** | `java-17` | -| **21.0.0.1** | `java-21` | +| **21.0.0** | `java-21` | | **24.0.0.1** | `java-24` | -## This 17.0.0 line +## This 21.0.0 line -**`17.0.0-SNAPSHOT`**: Java **17**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. Siblings **`smi-common-utils`** and **`smi-xsp`** at **`${project.version}`**. +**`21.0.0-SNAPSHOT`**: Java **21**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. Siblings **`smi-common-utils`** and **`smi-xsp`** at **`${project.version}`**. ## Build -- JDK **17+**, from repo root: `mvn -B "-Dgpg.skip=true" clean verify` (quote `-D` on PowerShell). +- JDK **21+**, from repo root: `mvn -B "-Dgpg.skip=true" clean verify` (quote `-D` on PowerShell). ## Doc split diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b09531..9378cf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ java-17 ] + branches: [ java-21 ] pull_request: - branches: [ java-17 ] + branches: [ java-21 ] permissions: contents: read @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-java@v5 with: distribution: temurin - java-version: "17" + java-version: "21" cache: maven - name: Maven verify run: mvn -B "-Dgpg.skip=true" clean verify diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ebf8e3..6a4d000 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log/Revision History +# = 21.0.0 = + +- Maven **`au.gov.nehta:common-library`** **21.0.0** (Java **21** / **Jakarta**). +- POM: **`maven.compiler.release` 21**; Jakarta XML APIs, **`jaxws-rt` 4.0.5**. +- Sibling **`smi-xsp`** and **`smi-common-utils`** at **`${project.version}`** (**21.0.0**). +- Enforcer requires JDK **21+**; **`maven-enforcer-plugin` 3.6.3**. +- Same utility surface as **17.0.0** on Java **21** bytecode. + # = 17.0.0 = - Maven **`au.gov.nehta:common-library`** **17.0.0** (Java **17** / **Jakarta**). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index be27036..a2a8bb1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,14 +4,14 @@ ## Prerequisites -- **JDK 17+** with **`JAVA_HOME`** set (see **`maven.compiler.release`** in **`pom.xml`**). +- **JDK 21+** with **`JAVA_HOME`** set (see **`maven.compiler.release`** in **`pom.xml`**). - **Maven 3.6+** on **`PATH`**. Dependencies resolve from **[Maven Central](https://central.sonatype.com/)** unless you are installing a **local SNAPSHOT** (below). This POM has no sibling Maven modules. ## Versioning -The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** version that this library targets. **17.0.0** targets Java **17** / **Jakarta**; **11.0.0** targets Java **11** / **Jakarta**; **8.0.0** uses **`javax`**. See **`README.md`**. +The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** version that this library targets. **21.0.0** targets Java **21** / **Jakarta**; **17.0.0** targets Java **17** / **Jakarta**; **11.0.0** targets Java **11** / **Jakarta**; **8.0.0** uses **`javax`**. See **`README.md`**. ## Build diff --git a/MAINTAINERS.md b/MAINTAINERS.md index e9ed5c7..5022750 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -13,7 +13,7 @@ The **first number** of **``** is the **Java SE** target of **this** li | **8.0.0** | **8** | | **11.0.0** | **11** | | **17.0.0** | **17** | -| **21.0.0.1** | **21** | +| **21.0.0** | **21** | | **24.0.0.1** | **24** | **Documentation convention:** README, CONTRIBUTING, CHANGELOG, and integrator-facing text use **version numbers only** - never Git branch names. @@ -23,7 +23,7 @@ The **first number** of **``** is the **Java SE** target of **this** li | **8.0.0** | 8 | **`javax.xml.ws`**, **`javax.xml.bind`** (via `jaxws-rt` 2.3.7) | | **11.0.0** | 11 | **Jakarta** XML WS / Bind | | **17.0.0** | 17 | **Jakarta** XML WS / Bind | -| **21.0.0.1** | 21 | **Jakarta** XML WS / Bind | +| **21.0.0** | 21 | **Jakarta** XML WS / Bind | | **24.0.0.1** | 24 | **Jakarta** XML WS / Bind | **Git branch mapping (maintainers / checkout only - do not use in integrator docs):** @@ -33,14 +33,14 @@ The **first number** of **``** is the **Java SE** target of **this** li | **8.0.0** | `java-8` | | **11.0.0** | `java-11` | | **17.0.0** | `java-17` | -| **21.0.0.1** | `java-21` | +| **21.0.0** | `java-21` | | **24.0.0.1** | `java-24` | Artifact id stays **`common-library`**; the version distinguishes the Java SE line. -On a given branch, **do not change the first number** of **``**. Next GA on **`java-17`** is **`17.0.0.1`** (then **`17.0.1-SNAPSHOT`**), not a different first number. A new Java SE target is a **new branch**, not a bump on this one. +On a given branch, **do not change the first number** of **``**. Next GA on **`java-21`** is **`21.0.0.1`** (then **`21.0.1-SNAPSHOT`**), not a different first number. A new Java SE target is a **new branch**, not a bump on this one. -**This checkout (`17.0.0-SNAPSHOT`):** Java **17**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. +**This checkout (`21.0.0-SNAPSHOT`):** Java **21**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. ## Artifact @@ -61,10 +61,10 @@ Publishing uses **`central-publishing-maven-plugin`** (Sonatype Central Portal). | **`java-8`** | 8 / javax | **8.0.0** | | **`java-11`** | 11 / Jakarta | **11.0.0** | | **`java-17`** | 17 / Jakarta | **17.0.0** | -| **`java-21`** | 21 / Jakarta | **21.0.0.1** | +| **`java-21`** | 21 / Jakarta | **21.0.0** | | **`java-24`** | 24 / Jakarta | **24.0.0.1** | -**`-DdevelopmentVersion`:** keep the same first number as **`-DreleaseVersion`** (example on this line: **`17.0.0`** then **`17.0.1-SNAPSHOT`**). +**`-DdevelopmentVersion`:** keep the same first number as **`-DreleaseVersion`** (example on this line: **`21.0.0`** then **`21.0.1-SNAPSHOT`**). ### SNAPSHOT or manual GA @@ -72,14 +72,14 @@ Publishing uses **`central-publishing-maven-plugin`** (Sonatype Central Portal). 2. **`mvn -B "-Prelease" clean verify`** 3. **`mvn -B "-Prelease" deploy`** -Tags default to **`{artifactId}-{version}`** (e.g. **`common-library-17.0.0`**). +Tags default to **`{artifactId}-{version}`** (e.g. **`common-library-21.0.0`**). ### Automated GA (`maven-release-plugin`) Run on the **target branch** with a **clean** working tree. ```text -mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=17.0.0 -DdevelopmentVersion=17.0.1-SNAPSHOT -Dtag=common-library-17.0.0 +mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=21.0.0 -DdevelopmentVersion=21.0.1-SNAPSHOT -Dtag=common-library-21.0.0 ``` **After success:** confirm **`common-library`** GA on Central before cutting downstream GAs. @@ -92,9 +92,9 @@ mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=17.0.0 -Ddev When adding a line (e.g. Java **25**): create **`java-25`** in **this** repository from the nearest existing line; set **``** first number to **25** (e.g. **`25.0.0.1-SNAPSHOT`**); set **`maven.compiler.release`**, Jakarta coordinates, CI **`java-version`** / branch filter, and docs to that line. Do not retarget an existing branch. -## Build (`17.0.0` line) +## Build (`21.0.0` line) -- **`maven.compiler.release` 17** +- **`maven.compiler.release` 21** - Runtime SOAP stack: **`com.sun.xml.ws:jaxws-rt` 4.0.5** in **consuming** applications - Sibling **`au.gov.nehta:smi-common-utils`** and **`au.gov.nehta:smi-xsp`**: **`${project.version}`** - **`maven-gpg-plugin`:** skipped unless **`-Dgpg.skip=false`** diff --git a/README.md b/README.md index 039a82c..dd95c1f 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ Published releases are consumed from **[Maven Central](https://central.sonatype. au.gov.nehta common-library - 17.0.0 + 21.0.0 ``` -**This line (`17.0.0`):** Java **17**, **Jakarta** XML APIs via **`jaxws-rt` 4.0.5**. +**This line (`21.0.0`):** Java **21**, **Jakarta** XML APIs via **`jaxws-rt` 4.0.5**. --- @@ -27,7 +27,7 @@ The **first number** of the Maven version is the **Java SE** version that this l | **8.0.0** | **8** | **`javax.*`** / EE4J **`jaxws-rt` 2.3.x** at runtime in consumers | | **11.0.0** | **11** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | | **17.0.0** | **17** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | -| **21.0.0.1** | **21** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | +| **21.0.0** | **21** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | | **24.0.0.1** | **24** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | Pick the coordinate that matches your JDK. All published versions are on **[Maven Central](https://central.sonatype.com/)**. @@ -36,7 +36,7 @@ Pick the coordinate that matches your JDK. All published versions are on **[Mave ## Local development (SNAPSHOT) -This repository builds **`17.0.0-SNAPSHOT`**. To make an unpublished JAR resolvable for other local projects: +This repository builds **`21.0.0-SNAPSHOT`**. To make an unpublished JAR resolvable for other local projects: ```text mvn -B "-Dgpg.skip=true" clean install @@ -48,7 +48,7 @@ If Maven warns that a **GA** POM is missing, clear stale **`au/gov/nehta/common- **Audience:** contributors changing this repository - not integrators adding a Maven dependency. -Prerequisites: **JDK 17+**, **Maven 3.6+**. +Prerequisites: **JDK 21+**, **Maven 3.6+**. ```text mvn -B "-Dgpg.skip=true" clean verify diff --git a/SECURITY.md b/SECURITY.md index 0e20621..400156a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,6 +8,7 @@ Report security-sensitive findings through your organisation's usual channel for | Version | Supported | | -------- | --------- | +| 21.0.0 | Yes | | 17.0.0 | Yes | | 11.0.0 | Yes | | 8.0.0 | Yes | diff --git a/pom.xml b/pom.xml index e97bdae..8a422d5 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ au.gov.nehta common-library - 17.0.0-SNAPSHOT + 21.0.0-SNAPSHOT ADHA/NEHTA Common Library Java classes for common code used by other ADHA/NEHTA libraries https://github.com/AuDigitalHealth/common-library-java @@ -65,7 +65,7 @@ - 17 + 21 UTF-8 ${encoding} ${encoding} @@ -84,7 +84,7 @@ true true [maven-release-plugin] - + 4.0.5 4.0.5 4.0.3 @@ -176,7 +176,7 @@ [3.6.3,) - [17,) + [21,) @@ -221,7 +221,7 @@ none false ${encoding} - 17 + ${maven.compiler.release} diff --git a/src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java b/src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java index 12a09b9..63a6eeb 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java @@ -20,24 +20,24 @@ import static org.junit.Assert.assertTrue; /** - * Locks this artifact on the Java 17 / 17.0.0 release line. + * Locks this artifact on the Java 21 / 21.0.0 release line. */ public class ReleaseLineTest { @Test - public void runtimeFeatureIsAtLeast17() { - assertTrue(Runtime.version().feature() >= 17); + public void runtimeFeatureIsAtLeast21() { + assertTrue(Runtime.version().feature() >= 21); } @Test - public void mavenCompilerReleaseIs17() { - assertEquals("17", System.getProperty("common.library.compiler.release")); + public void mavenCompilerReleaseIs21() { + assertEquals("21", System.getProperty("common.library.compiler.release")); } @Test - public void projectVersionStartsWith17() { + public void projectVersionStartsWith21() { String version = System.getProperty("common.library.project.version"); assertNotNull(version); - assertTrue(version.startsWith("17.")); + assertTrue(version.startsWith("21.")); } } From 455fcd2b22a67d1a9e1159c139802c40a1889a8d Mon Sep 17 00:00:00 2001 From: Gavin Baumanis Date: Wed, 26 Aug 2026 00:24:20 +1000 Subject: [PATCH 4/4] Release 24.0.0: Java 24 / Jakarta. Uplift the 21.0.0 line to 24.0.0-SNAPSHOT with maven.compiler.release 24, sibling au.gov.nehta deps at ${project.version}, and docs/CI for the java-24 public line. --- .cursor/rules/common-library-project.mdc | 34 +++++++++---------- .github/workflows/ci.yml | 6 ++-- CHANGELOG.md | 8 +++++ CONTRIBUTING.md | 4 +-- MAINTAINERS.md | 24 ++++++------- README.md | 10 +++--- SECURITY.md | 1 + pom.xml | 8 ++--- .../vendorlibrary/common/ReleaseLineTest.java | 14 ++++---- 9 files changed, 59 insertions(+), 50 deletions(-) diff --git a/.cursor/rules/common-library-project.mdc b/.cursor/rules/common-library-project.mdc index 58b5096..523a106 100644 --- a/.cursor/rules/common-library-project.mdc +++ b/.cursor/rules/common-library-project.mdc @@ -13,31 +13,31 @@ Follow **`documentation-standards.mdc`**. Integrator docs use **version numbers* The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** target, aligned with the HI/MHR client release lines. -| Version | Java | XML stack | -| ------------ | ---- | ----------- | -| **8.0.0** | 8 | **javax** | -| **11.0.0** | 11 | **Jakarta** | -| **17.0.0** | 17 | **Jakarta** | -| **21.0.0** | 21 | **Jakarta** | -| **24.0.0.1** | 24 | **Jakarta** | +| Version | Java | XML stack | +| ---------- | ---- | ----------- | +| **8.0.0** | 8 | **javax** | +| **11.0.0** | 11 | **Jakarta** | +| **17.0.0** | 17 | **Jakarta** | +| **21.0.0** | 21 | **Jakarta** | +| **24.0.0** | 24 | **Jakarta** | **Git branch mapping (maintainers only - never in integrator docs):** -| Version | Official Git branch | -| ------------ | ------------------- | -| **8.0.0** | `java-8` | -| **11.0.0** | `java-11` | -| **17.0.0** | `java-17` | -| **21.0.0** | `java-21` | -| **24.0.0.1** | `java-24` | +| Version | Official Git branch | +| ---------- | ------------------- | +| **8.0.0** | `java-8` | +| **11.0.0** | `java-11` | +| **17.0.0** | `java-17` | +| **21.0.0** | `java-21` | +| **24.0.0** | `java-24` | -## This 21.0.0 line +## This 24.0.0 line -**`21.0.0-SNAPSHOT`**: Java **21**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. Siblings **`smi-common-utils`** and **`smi-xsp`** at **`${project.version}`**. +**`24.0.0-SNAPSHOT`**: Java **24**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. Siblings **`smi-common-utils`** and **`smi-xsp`** at **`${project.version}`**. ## Build -- JDK **21+**, from repo root: `mvn -B "-Dgpg.skip=true" clean verify` (quote `-D` on PowerShell). +- JDK **24+**, from repo root: `mvn -B "-Dgpg.skip=true" clean verify` (quote `-D` on PowerShell). ## Doc split diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9378cf6..d7298d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ java-21 ] + branches: [ java-24 ] pull_request: - branches: [ java-21 ] + branches: [ java-24 ] permissions: contents: read @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-java@v5 with: distribution: temurin - java-version: "21" + java-version: "24" cache: maven - name: Maven verify run: mvn -B "-Dgpg.skip=true" clean verify diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a4d000..6cb2882 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log/Revision History +# = 24.0.0 = + +- Maven **`au.gov.nehta:common-library`** **24.0.0** (Java **24** / **Jakarta**). +- POM: **`maven.compiler.release` 24**; Jakarta XML APIs, **`jaxws-rt` 4.0.5**. +- Sibling **`smi-xsp`** and **`smi-common-utils`** at **`${project.version}`** (**24.0.0**). +- Enforcer requires JDK **24+**; **`maven-enforcer-plugin` 3.6.3**. +- Same utility surface as **21.0.0** on Java **24** bytecode. + # = 21.0.0 = - Maven **`au.gov.nehta:common-library`** **21.0.0** (Java **21** / **Jakarta**). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a2a8bb1..cbea2d4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,14 +4,14 @@ ## Prerequisites -- **JDK 21+** with **`JAVA_HOME`** set (see **`maven.compiler.release`** in **`pom.xml`**). +- **JDK 24+** with **`JAVA_HOME`** set (see **`maven.compiler.release`** in **`pom.xml`**). - **Maven 3.6+** on **`PATH`**. Dependencies resolve from **[Maven Central](https://central.sonatype.com/)** unless you are installing a **local SNAPSHOT** (below). This POM has no sibling Maven modules. ## Versioning -The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** version that this library targets. **21.0.0** targets Java **21** / **Jakarta**; **17.0.0** targets Java **17** / **Jakarta**; **11.0.0** targets Java **11** / **Jakarta**; **8.0.0** uses **`javax`**. See **`README.md`**. +The **first number** of **`au.gov.nehta:common-library`** is the **Java SE** version that this library targets. **24.0.0** targets Java **24** / **Jakarta**; **21.0.0** targets Java **21** / **Jakarta**; **17.0.0** targets Java **17** / **Jakarta**; **11.0.0** targets Java **11** / **Jakarta**; **8.0.0** uses **`javax`**. See **`README.md`**. ## Build diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 5022750..56d26e0 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -14,7 +14,7 @@ The **first number** of **``** is the **Java SE** target of **this** li | **11.0.0** | **11** | | **17.0.0** | **17** | | **21.0.0** | **21** | -| **24.0.0.1** | **24** | +| **24.0.0** | **24** | **Documentation convention:** README, CONTRIBUTING, CHANGELOG, and integrator-facing text use **version numbers only** - never Git branch names. @@ -24,7 +24,7 @@ The **first number** of **``** is the **Java SE** target of **this** li | **11.0.0** | 11 | **Jakarta** XML WS / Bind | | **17.0.0** | 17 | **Jakarta** XML WS / Bind | | **21.0.0** | 21 | **Jakarta** XML WS / Bind | -| **24.0.0.1** | 24 | **Jakarta** XML WS / Bind | +| **24.0.0** | 24 | **Jakarta** XML WS / Bind | **Git branch mapping (maintainers / checkout only - do not use in integrator docs):** @@ -34,13 +34,13 @@ The **first number** of **``** is the **Java SE** target of **this** li | **11.0.0** | `java-11` | | **17.0.0** | `java-17` | | **21.0.0** | `java-21` | -| **24.0.0.1** | `java-24` | +| **24.0.0** | `java-24` | Artifact id stays **`common-library`**; the version distinguishes the Java SE line. -On a given branch, **do not change the first number** of **``**. Next GA on **`java-21`** is **`21.0.0.1`** (then **`21.0.1-SNAPSHOT`**), not a different first number. A new Java SE target is a **new branch**, not a bump on this one. +On a given branch, **do not change the first number** of **``**. Next GA on **`java-24`** is **`24.0.0.1`** (then **`24.0.1-SNAPSHOT`**), not a different first number. A new Java SE target is a **new branch**, not a bump on this one. -**This checkout (`21.0.0-SNAPSHOT`):** Java **21**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. +**This checkout (`24.0.0-SNAPSHOT`):** Java **24**, **Jakarta** XML APIs, **`jaxws-rt` 4.0.5**. ## Artifact @@ -62,9 +62,9 @@ Publishing uses **`central-publishing-maven-plugin`** (Sonatype Central Portal). | **`java-11`** | 11 / Jakarta | **11.0.0** | | **`java-17`** | 17 / Jakarta | **17.0.0** | | **`java-21`** | 21 / Jakarta | **21.0.0** | -| **`java-24`** | 24 / Jakarta | **24.0.0.1** | +| **`java-24`** | 24 / Jakarta | **24.0.0** | -**`-DdevelopmentVersion`:** keep the same first number as **`-DreleaseVersion`** (example on this line: **`21.0.0`** then **`21.0.1-SNAPSHOT`**). +**`-DdevelopmentVersion`:** keep the same first number as **`-DreleaseVersion`** (example on this line: **`24.0.0`** then **`24.0.1-SNAPSHOT`**). ### SNAPSHOT or manual GA @@ -72,14 +72,14 @@ Publishing uses **`central-publishing-maven-plugin`** (Sonatype Central Portal). 2. **`mvn -B "-Prelease" clean verify`** 3. **`mvn -B "-Prelease" deploy`** -Tags default to **`{artifactId}-{version}`** (e.g. **`common-library-21.0.0`**). +Tags default to **`{artifactId}-{version}`** (e.g. **`common-library-24.0.0`**). ### Automated GA (`maven-release-plugin`) Run on the **target branch** with a **clean** working tree. ```text -mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=21.0.0 -DdevelopmentVersion=21.0.1-SNAPSHOT -Dtag=common-library-21.0.0 +mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=24.0.0 -DdevelopmentVersion=24.0.1-SNAPSHOT -Dtag=common-library-24.0.0 ``` **After success:** confirm **`common-library`** GA on Central before cutting downstream GAs. @@ -90,11 +90,11 @@ mvn -B "-Prelease" release:prepare release:perform -DreleaseVersion=21.0.0 -Ddev ## New Java SE line -When adding a line (e.g. Java **25**): create **`java-25`** in **this** repository from the nearest existing line; set **``** first number to **25** (e.g. **`25.0.0.1-SNAPSHOT`**); set **`maven.compiler.release`**, Jakarta coordinates, CI **`java-version`** / branch filter, and docs to that line. Do not retarget an existing branch. +When adding a line (e.g. Java **25**): create **`java-25`** in **this** repository from the nearest existing line; set **``** first number to **25** (e.g. **`25.0.0-SNAPSHOT`**); set **`maven.compiler.release`**, Jakarta coordinates, CI **`java-version`** / branch filter, and docs to that line. Do not retarget an existing branch. -## Build (`21.0.0` line) +## Build (`24.0.0` line) -- **`maven.compiler.release` 21** +- **`maven.compiler.release` 24** - Runtime SOAP stack: **`com.sun.xml.ws:jaxws-rt` 4.0.5** in **consuming** applications - Sibling **`au.gov.nehta:smi-common-utils`** and **`au.gov.nehta:smi-xsp`**: **`${project.version}`** - **`maven-gpg-plugin`:** skipped unless **`-Dgpg.skip=false`** diff --git a/README.md b/README.md index dd95c1f..a59bed9 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ Published releases are consumed from **[Maven Central](https://central.sonatype. au.gov.nehta common-library - 21.0.0 + 24.0.0 ``` -**This line (`21.0.0`):** Java **21**, **Jakarta** XML APIs via **`jaxws-rt` 4.0.5**. +**This line (`24.0.0`):** Java **24**, **Jakarta** XML APIs via **`jaxws-rt` 4.0.5**. --- @@ -28,7 +28,7 @@ The **first number** of the Maven version is the **Java SE** version that this l | **11.0.0** | **11** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | | **17.0.0** | **17** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | | **21.0.0** | **21** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | -| **24.0.0.1** | **24** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | +| **24.0.0** | **24** | **Jakarta** / EE4J **`jaxws-rt` 4.0.x** at runtime in consumers | Pick the coordinate that matches your JDK. All published versions are on **[Maven Central](https://central.sonatype.com/)**. @@ -36,7 +36,7 @@ Pick the coordinate that matches your JDK. All published versions are on **[Mave ## Local development (SNAPSHOT) -This repository builds **`21.0.0-SNAPSHOT`**. To make an unpublished JAR resolvable for other local projects: +This repository builds **`24.0.0-SNAPSHOT`**. To make an unpublished JAR resolvable for other local projects: ```text mvn -B "-Dgpg.skip=true" clean install @@ -48,7 +48,7 @@ If Maven warns that a **GA** POM is missing, clear stale **`au/gov/nehta/common- **Audience:** contributors changing this repository - not integrators adding a Maven dependency. -Prerequisites: **JDK 21+**, **Maven 3.6+**. +Prerequisites: **JDK 24+**, **Maven 3.6+**. ```text mvn -B "-Dgpg.skip=true" clean verify diff --git a/SECURITY.md b/SECURITY.md index 400156a..4961bfc 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,6 +8,7 @@ Report security-sensitive findings through your organisation's usual channel for | Version | Supported | | -------- | --------- | +| 24.0.0 | Yes | | 21.0.0 | Yes | | 17.0.0 | Yes | | 11.0.0 | Yes | diff --git a/pom.xml b/pom.xml index 8a422d5..50c1894 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ au.gov.nehta common-library - 21.0.0-SNAPSHOT + 24.0.0-SNAPSHOT ADHA/NEHTA Common Library Java classes for common code used by other ADHA/NEHTA libraries https://github.com/AuDigitalHealth/common-library-java @@ -65,7 +65,7 @@ - 21 + 24 UTF-8 ${encoding} ${encoding} @@ -84,7 +84,7 @@ true true [maven-release-plugin] - + 4.0.5 4.0.5 4.0.3 @@ -176,7 +176,7 @@ [3.6.3,) - [21,) + [24,) diff --git a/src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java b/src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java index 63a6eeb..fd26c25 100644 --- a/src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java +++ b/src/test/java/au/gov/nehta/vendorlibrary/common/ReleaseLineTest.java @@ -20,24 +20,24 @@ import static org.junit.Assert.assertTrue; /** - * Locks this artifact on the Java 21 / 21.0.0 release line. + * Locks this artifact on the Java 24 / 24.0.0 release line. */ public class ReleaseLineTest { @Test - public void runtimeFeatureIsAtLeast21() { - assertTrue(Runtime.version().feature() >= 21); + public void runtimeFeatureIsAtLeast24() { + assertTrue(Runtime.version().feature() >= 24); } @Test - public void mavenCompilerReleaseIs21() { - assertEquals("21", System.getProperty("common.library.compiler.release")); + public void mavenCompilerReleaseIs24() { + assertEquals("24", System.getProperty("common.library.compiler.release")); } @Test - public void projectVersionStartsWith21() { + public void projectVersionStartsWith24() { String version = System.getProperty("common.library.project.version"); assertNotNull(version); - assertTrue(version.startsWith("21.")); + assertTrue(version.startsWith("24.")); } }