Repository navigation
docs(xsd-java): run XsdValidate.java directly via JDK source launcher (no Maven needed) - #22
Merged
Merged
Conversation
…Maven needed XsdValidate.java has no dependency beyond the JDK (javax.xml.validation + java.net.http), so JDK 11+ can compile and run it directly (JEP 330): java XSD_Validation/java/XsdValidate.java <schema> <xml-file> Document this as the primary invocation in the class header, the module pom.xml comment, XSD_Validation/README.md and the root README; keep the Maven aggregator path as the alternative that CI uses. Also fix the pom.xml comment, which still described the pre-#21 version resolution (env var / cache / "4.2.9" arg). Robustness: a missing, unreadable or malformed schema now exits 2 with a one-line message instead of stack-tracing out with exit 1, matching the documented exit codes (0 valid / 1 invalid / 2 usage or setup error). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YXZWhwE5EbHSybt55K6oUZ
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.
Summary
XSD_Validation/java/XsdValidate.javahas zero dependencies beyond the JDK, so Maven is not required to run it. JDK 11+ compiles and runs the single source file directly:pom.xmlcomment,XSD_Validation/README.md, rootREADME.md); the./mvnw … exec:javapath stays as the alternative CI uses.pom.xmlcomment was stale (still described env-var/cache/4.2.9version resolution removed in refactor(xsd): validators take <schema> <xml-file>, drop version-based resolution #21) — fixed.Verification (JDK 26, local)
java …/XsdValidate.java $REL Mixed-Fund_Positions.xmljava …/XsdValidate.java $REL tests/fixtures/invalid/xsd-invalid_Positions.xmljava …/XsdValidate.java /nonexistent.xsd …cannot load schema …, exit 2./mvnw -q -pl XSD_Validation/java compile exec:java …CI is unchanged (still exercises the Maven path).
🤖 Generated with Claude Code
https://claude.ai/code/session_01YXZWhwE5EbHSybt55K6oUZ