-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
Currently, com.approvaltests:approvaltests:18.5.0 has a lot of "optional" dependencies.
However, in practice, it makes it hard to use the library.
For instance, I wanted to try json approvals, so I tried JsonApprovals.verifyJson("test"), and the test failed in runtime with
com/google/gson/JsonSyntaxException
java.lang.NoClassDefFoundError: com/google/gson/JsonSyntaxException
at org.approvaltests.JsonApprovals.verifyJson(JsonApprovals.java:20)
at org.approvaltests.JsonApprovals.verifyJson(JsonApprovals.java:16)
Of course, I'm a programmer, and I know NoClassDefFoundError means the class is missing in runtime, because, well, my app does not really use Gson.
If Approvals wants Gson, fine, however, I would suggest adding a regular (non-optional) dependency.
So if you split modules like
approvaltests-core
approvaltests-json-gson: depends on approvaltests-core, and gson
approvaltests-json-jackson: depends on approvaltests-core, and jackson
approvaltests: depends on approvaltests-core, approvaltests-json-* dependencies for backward compatibility
Then the users would be able to pull just the libraries they need (e.g. approvaltests-json-jackson), and they would get all the needed (e.g. jackson) dependencies automatically.
oratnikov and cgtLarsEckart
Metadata
Metadata
Assignees
Labels
No labels