diff --git a/.github/PULL_REQUEST_TEMPLATE/java24-upgrade.md b/.github/PULL_REQUEST_TEMPLATE/java24-upgrade.md new file mode 100644 index 0000000..0c5542c --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/java24-upgrade.md @@ -0,0 +1,13 @@ +## Summary +- Spec issue: #87 +- ADR/design review discussion: https://github.com/ganesh47/java-99-problems/discussions/86 +- Wiki page for spec/ADR: https://github.com/ganesh47/java-99-problems/wiki/Spec-Upgrade-Java-Baseline-to-24 + +## Required checks +- [ ] spec-kit templates refreshed (`specs scan --refresh-spec-kit` or `specs templates`) +- [ ] Spec-kit availability check passed (`npm run spec-kit:check`) +- [ ] Specs coverage run +- [ ] Example conformance run (if applicable) +- [ ] Security scans (Semgrep/OSV-Scanner/Gitleaks/Checkov) green +- [ ] ADR/design review approved before merge +- [ ] Issue and project status updated (Todo → In Progress → Done) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8442287..8eda346 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,7 @@ jobs: - name: Configure Java-specific args run: | if [ "${{ matrix.java }}" = "24" ]; then + echo "SpotBugs is skipped on Java 24 to keep CI green." echo "EXTRA_ARGS=-Dspotbugs.skip=true" >> "$GITHUB_ENV" fi diff --git a/CHANGELOG.md b/CHANGELOG.md index f85c1a4..ad4b8b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v0.2.0 - Java 24 baseline +- Set Java 24 as the default toolchain in Maven and align plugin configs. +- Document Java 24 usage in README and keep CI green on Java 24. + ## v0.1.0 - Specs bootstrap - Add specs scaffolding, Codex wrappers, and guard/coverage/security/release workflows. - Add spec-kit template availability check and ADR/wiki automation for specs sync. diff --git a/README.md b/README.md index 8d19f1e..cc75928 100644 --- a/README.md +++ b/README.md @@ -47,9 +47,10 @@ bash ./mvnw test 1. Clone the repository 2. Import as a Maven project -3. Browse the problems in order, starting from P01 -4. Run tests to verify your understanding -5. Check the test cases for usage examples +3. Use Java 24 (Temurin 24 recommended) +4. Browse the problems in order, starting from P01 +5. Run tests to verify your understanding +6. Check the test cases for usage examples Each problem's implementation and its corresponding test class can be studied independently, making it easy to focus on specific concepts or challenges. diff --git a/pom.xml b/pom.xml index 53e84ab..e7a9787 100644 --- a/pom.xml +++ b/pom.xml @@ -9,6 +9,9 @@ 1.0-SNAPSHOT + 24 + + 23 ${java.version} ${java.version} ${java.version} @@ -63,7 +66,7 @@ maven-pmd-plugin 3.26.0 - 22 + ${pmd.targetJdk} @@ -93,8 +96,7 @@ maven-compiler-plugin 3.13.0 - 22 - 22 + ${java.version} diff --git a/specs/java-99-java24-upgrade.feature.md b/specs/java-99-java24-upgrade.feature.md new file mode 100644 index 0000000..7b1f7e5 --- /dev/null +++ b/specs/java-99-java24-upgrade.feature.md @@ -0,0 +1,38 @@ +--- +spec_id: java24.upgrade +title: Upgrade Java Baseline to 24 +features: + - id: toolchain.java24 + accept: + - "pom.xml defines java.version=24 and compiler config consumes the property" + - "PMD targetJdk is pinned to the highest supported level with rationale noted" + - "mvnw verify defaults to Java 24 when no -Djava.version override is supplied" + - id: ci.java24 + accept: + - "CI builds include Java 24 and pass with -Djava.version=24" + - "Java 24-specific skips (if any) are documented and keep checks green" + - id: examples.java24 + accept: + - "Problem implementations and tests compile/run under Java 24 in CI" + - id: docs.release + accept: + - "CHANGELOG.md contains a v0.2.0 entry for the Java 24 upgrade" + - "Release workflow publishes v0.2.0 with coverage artifact and ADR/wiki links" + - id: spec.workflow + accept: + - "Spec issue/ADR/wiki links created via specs sync and ADR approved before implementation" + - "PR uses the spec template with issue/ADR/wiki links and required checks green" +--- + +## Summary +Move the java-99-problems baseline to Java 24 by updating the Maven toolchain defaults and CI expectations. This keeps local builds consistent with CI, and documents the change via changelog and release automation. + +## Workflow +- Todo → In Progress: create spec, sync issue/ADR/wiki, and approve ADR. +- Implementation: update pom toolchain defaults to Java 24 and align plugin configs; keep CI green. +- Release: add changelog entry and run release workflow for v0.2.0. +- Done: sync and close the spec after release and green checks. + +## Notes +- CI already runs Java 24; this spec makes Java 24 the default without overrides. +- If any plugin requires a temporary Java 24 skip, document it in the workflow. diff --git a/specs/java-99-java24-upgrade.plan.md b/specs/java-99-java24-upgrade.plan.md new file mode 100644 index 0000000..7acd5bb --- /dev/null +++ b/specs/java-99-java24-upgrade.plan.md @@ -0,0 +1,39 @@ +# Implementation Plan: java24.upgrade + +**Branch**: `java24-upgrade` | **Date**: 2026-01-03 | **Spec**: specs/java-99-java24-upgrade.feature.md +**Input**: Spec doc + spec-kit templates (`specs templates` or `specs scan --refresh-spec-kit`) + +## Summary +Set Java 24 as the default toolchain by updating Maven properties and plugin configs, keep CI green on Java 24, document the change in CHANGELOG.md, and ship a v0.2.0 release. + +## Technical Context +**Language/Version**: Java (Maven), target baseline 24 +**Primary Dependencies**: Maven compiler plugin, PMD, SpotBugs, GitHub Actions +**Testing**: Maven CI workflow (build.yml), specs guard/coverage/security +**Target Platform**: GitHub repo with Specs Board + release workflow + +## Project Structure +``` +specs/ +├── java-99-java24-upgrade.feature.md +├── java-99-java24-upgrade.plan.md +└── java-99-java24-upgrade.tasks.md +pom.xml +.github/workflows/build.yml +CHANGELOG.md +``` + +## Implementation Strategy +1) Create spec + plan/tasks; run `specs sync` to open issue/ADR/wiki. +2) Approve ADR before implementation. +3) Update pom defaults: define java.version=24 and align compiler/PMD configs to use it. +4) Ensure CI expectations for Java 24 remain green; document any 24-specific skips. +5) Add v0.2.0 entry to CHANGELOG.md and run release workflow with issue/ADR/wiki links. +6) Run `specs sync` and `specs close` after release and green checks. + +## Dependencies & Execution Order +- ADR approval before implementation. +- Release requires CHANGELOG.md entry for v0.2.0. + +## Notes +- Use the spec-specific PR template with issue/ADR/wiki links. diff --git a/specs/java-99-java24-upgrade.tasks.md b/specs/java-99-java24-upgrade.tasks.md new file mode 100644 index 0000000..5d9241d --- /dev/null +++ b/specs/java-99-java24-upgrade.tasks.md @@ -0,0 +1,24 @@ +# Tasks: java24.upgrade + +**Input**: spec (`specs/java-99-java24-upgrade.feature.md`), plan (`specs/java-99-java24-upgrade.plan.md`), spec-kit templates +**Prerequisites**: ADR approved; templates refreshed + +## Format: `[ID] [P?] [Story] Description` + +## Phase 1: Spec setup +- [ ] T001 [P] [SPEC] Create spec, plan, and tasks files. +- [ ] T002 [P] [SPEC] Run `specs sync` to create issue/ADR/wiki links. +- [ ] T003 [P] [SPEC] Approve ADR and update with plan/tasks. + +## Phase 2: Java 24 baseline +- [ ] T010 [P] [BUILD] Define java.version=24 and align compiler/PMD configs. +- [ ] T011 [P] [BUILD] Confirm CI Java 24 checks remain green; document any 24-specific skips. +- [ ] T012 [P] [BUILD] Add spec-specific PR template with issue/ADR/wiki links. + +## Phase 3: Release + close +- [ ] T020 [P] [REL] Add v0.2.0 entry to CHANGELOG.md. +- [ ] T021 [P] [REL] Run release workflow for v0.2.0 (issue/ADR/wiki inputs). +- [ ] T022 [P] [REL] Run `specs close java24.upgrade --issue <#> --pr <#>` after release + green checks. + +## Dependencies & Execution Order +- Phase 1 → Phase 2 → Phase 3.