Phase 1: Java examples standalone & cross-platform via Maven - #14
Merged
Merged
Conversation
Replace the bash-only Java toolchain (tools/fetch-tools.sh + raw javac + .lib/ ":"-classpaths + run-*.sh wrappers) with a standard Maven build so every Java example runs on Windows too, with no prior tool step. - Root pom.xml aggregator + committed Maven Wrapper (mvnw/mvnw.cmd, only-script, Maven 3.9.9) so no preinstalled Maven is needed. - One module per example; <sourceDirectory> left at the existing flat example dirs so the teaching sources do not move. Dependency versions pinned to exactly what fetch-tools.sh used (behaviour unchanged). The SchXslt (bundled-Saxon) module is kept separate from the Saxon-HE XSLT/XQuery modules to preserve the org.xmlresolver-conflict fix. - XsdValidate resolves the official XSD itself: $FUNDSXML_SCHEMA_DIR (offline/corporate escape hatch) -> .schema-cache/ -> download from the GitHub release (follows the 302, fetches the xmldsig sibling when imported). Source of truth stays the official release; no committed catalog. - New XML_Signature/java/GenerateTestKey.java generates the throwaway signing key with the JDK's own keytool (no openssl) -> works on Windows. - Deleted: tools/fetch-tools.sh, run-schematron.sh, run-transform.sh, run-xquery.sh, generate-test-key.sh. - ci.yml: all Java steps now drive ./mvnw; exit codes propagate (blockSystemExit=false) so negative-fixture asserts still hold. - Docs swept (READMEs / CONTRIBUTING / issue template / .gitignore) to the Maven Wrapper commands; not-yet-migrated Python/.NET reference comments no longer point at deleted scripts. Verified locally via ./mvnw: XSD (env/cache/download + negative fixture), Schematron (±), XSLT, XQuery, sign/verify/tamper, DB round-trip + xml_equiv + XSD-valid, large-file streaming, data binding. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Every Java example used to depend on bash:
tools/fetch-tools.sh(jars into a gitignored.lib/) + rawjavac+:-separated classpaths +run-*.shwrappers. None of that runs on Windows and it required a prior tool step. This is Phase 1 of 4 of making all examples standalone & cross-platform (plan: per-language idiomatic build systems, no bash prerequisite).What changed (Java only)
pom.xmlaggregator + committed Maven Wrapper (mvnw/mvnw.cmd,only-script, Maven 3.9.9) — no preinstalled Maven needed.<sourceDirectory>left at the existing flat dirs so the teaching sources don't move. Dependency versions pinned to exactly whatfetch-tools.shused → behaviour unchanged. SchXslt (bundles its own Saxon) kept in its own module, separate from the Saxon-HE XSLT/XQuery modules, preserving the documentedorg.xmlresolverconflict fix.XsdValidate.java:$FUNDSXML_SCHEMA_DIR(offline / corporate-network escape hatch) →.schema-cache/→ download from the official GitHub release (follows the 302, fetches thexmldsig-core-schema.xsdsibling when imported). Official release stays the source of truth; no committed catalog.GenerateTestKey.javareplaces the opensslgenerate-test-key.shusing the JDK's ownkeytool→ works on Windows.tools/fetch-tools.sh,run-schematron.sh,run-transform.sh,run-xquery.sh,generate-test-key.sh../mvnw;blockSystemExit=falseso the example's exit code propagates and the negative-fixture assertions still hold.fetch-schema.shkept (xmllint/Python/.NET still need the cache until their phases).CONTRIBUTING.md, issue template,.gitignore; not-yet-migrated Python/.NET reference comments no longer point at deleted scripts.Verification
Run locally from the repo root via
./mvnw(all green): XSD validation (env-var / cache-hit / cold download + negative fixture exits 1), Schematron (positive 0 errors / negative exits 1), XSLT (custom DQ, factsheet HTML+FO, CSV), XQuery (top-holdings n=5 → 5 holdings), XML signature (keygen → sign → verify OK → tamper → INVALID), DB round-trip (import→export,xml_equivequal, XSD-valid), large-file streaming, native data binding. Clean-state./mvnw -q -B clean compilesucceeds for the whole reactor.Phases 2 (Python), 3 (.NET), 4 (CLI pair + final bash purge + windows-latest CI) follow as separate PRs.
🤖 Generated with Claude Code