Skip to content

Declare optional provider dependencies in the Maven POM - #1094

Open
hutiefang76 wants to merge 1 commit into
json-path:masterfrom
hutiefang76:frank/fix-jsonpath1082-optional-providers-20261124
Open

hutiefang76 wants to merge 1 commit into
json-path:masterfrom
hutiefang76:frank/fix-jsonpath1082-optional-providers-20261124

Conversation

@hutiefang76

Copy link
Copy Markdown

Fixes #1082.

The generated POM currently lists json-smart and slf4j-api but omits the compile-only APIs used by the provider classes shipped in the JAR. Add those existing dependency coordinates to the POM with optional=true, so POM-based tooling can discover Jackson 2, Jackson 3, Gson, JSON.org, Tapestry, Jettison, and the Jakarta JSON-P/JSON-B APIs. Versions come from the existing declarations; normal Maven consumers continue to resolve the default provider dependencies.

Validation:

  • Gradle 8.5 clean build check and both modules' POM generation pass on JDK 17.0.18 and 21.0.10. Each run reports 1,026 tests, with 0 failures/errors and 13 skipped (1,013 passed).
  • The generated json-path POM has one dependencies section, the same two required dependencies, and eight optional provider APIs with their declared versions. json-path-assert retains its three required dependencies.
  • Four separate Maven consumers resolve the actual generated JAR/POM from an isolated local repository. The default client reads JSON successfully with all eight optional API classes absent. Clients explicitly adding Gson, Jackson 2, or Jackson 3 each perform a typed JsonPath read with the selected provider and mapper.

AI assistance: DeepSeek and OpenAI Codex.

Generated-by: DeepSeek

Generated-by: OpenAI Codex

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Published POM omits the optional provider dependencies (jackson, gson)

1 participant