This branch is based on json-lib 3.2.0 and includes GeoServer compatibility and operational fixes used in previous 2.x maintenance work.
- Makes JSON nesting depth configurable (instead of hardcoded 20).
- Sets default max depth to
100(backward-compatible with GeoServer expectations). - Adds upper bound clamp to avoid OOM from very large
json.maxDepthvalues. - Preserves legacy single-quoted string normalization behavior on programmatic APIs.
- Preserves legacy number coercion behavior in numeric parsing.
- Updates
commons-lang3dependency to3.18.0.
These are JVM system properties.
-
json.maxDepth- Default:
100 - Behavior: maximum builder nesting depth.
- Clamp: values above
10000are clamped to10000. - Example:
-Djson.maxDepth=250
- Default:
-
json.compatibility.stripSingleQuotedStringValues- Default:
true - Behavior: when
true, object-typed string values surrounded by single quotes are normalized by stripping outer quotes in APIs such asJSONObject.element(...),JSONObject.accumulate(...), andJSONArray.element(Object, JsonConfig). - Public constant:
JSONObject.LEGACY_SINGLE_QUOTED_STRING_VALUES_PROPERTY - Example:
-Djson.compatibility.stripSingleQuotedStringValues=false
- Default:
-
json.compatibility.legacyNumberCoercion- Default:
true - Behavior: keeps legacy numeric coercion semantics in
JSONTokener#createNumber. - Example:
-Djson.compatibility.legacyNumberCoercion=false
- Default:
From repository root:
./gradlew clean buildRun all tests:
./gradlew :json-lib-core:testRun a single test class:
./gradlew :json-lib-core:test --tests org.kordamp.json.TestJSONObjectNotes:
- Source/target compatibility are Java 8 (
1.8) ingradle.properties. - Building with newer JDKs (for example JDK 17) is supported by current project setup.
- License checks can be disabled with
-PdisableLicenseChecks=true(already enabled in this fork'sgradle.properties).
An automated script is provided:
scripts/publish-geosolutions.sh
It performs:
- Local publish to staged Maven repo:
:json-lib-core:publishMainPublicationToLocalReleaseRepository
- SFTP upload of artifacts +
maven-metadata.xml*to GeoSolutions. - Idempotent remote directory creation using SFTP only (creates missing dirs, skips existing ones).
--version <v>: version to publish (default:VERSIONfile).--key <path>: private key (default:~/.ssh/id_rsa_maven_tmp).--host <host>: SFTP host (default:maven.geo-solutions.it).--user <user>: SFTP user (default:maven).--remote-base <path>: remote artifact base path (default:/org/kordamp/json/json-lib-core).--skip-build: skip Gradle publish, upload staged files only.--dry-run: print actions without uploading.--no-sbom: do not pass-Pprofile=sbom.--no-reproducible: do not pass-PreproducibleBuild=true.
Preview:
scripts/publish-geosolutions.sh --dry-runBuild + upload:
scripts/publish-geosolutions.sh --key ~/.ssh/id_rsa_maven_tmpUpload only (if already staged):
scripts/publish-geosolutions.sh --skip-build --key ~/.ssh/id_rsa_maven_tmpIf your server layout still uses the legacy path:
scripts/publish-geosolutions.sh \
--skip-build \
--key ~/.ssh/id_rsa_maven_tmp \
--remote-base /net/sf/json-lib/json-lib