ssilverman / snowy-json

Snow, a full-featured JSON Schema validator
GNU Affero General Public License v3.0
53 stars 5 forks source link

parseReader not found error #16

Closed 573 closed 2 years ago

573 commented 2 years ago

With the Main and the artifact added to my pom.xml I get:

Exception in thread "main" java.lang.NoSuchMethodError: 'com.google.gson.JsonElement com.google.gson.JsonParser.parseReader(java.io.Reader)' at com.qindesign.json.schema.JSON.parse(JSON.java:132) at com.qindesign.json.schema.JSON.parse(JSON.java:119) at com.qindesign.json.schema.JSON.parse(JSON.java:91) at de.elster.testing.common.validator.Main.main(Main.java:86)

Does that mean to use the Main as an example I needed to copy all classes over ? How are the classes meant to be used in my project ? There aren't any class files when adding the artifact to the pom and rebuilding my project.

I guess I am being very noob or confused here.

Wait, is the scope of it being a scaffold for how to integrate JSON validation into mvn ? As such it does an excellent job !

573 commented 2 years ago

It seems as though my pom involved gson version 2.8.2 and explicitly adding

<dependency>
  <groupId>com.google.code.gson</groupId>
  <artifactId>gson</artifactId>
  <version>2.8.6</version>
</dependency>

fixed it, meaning the Main from this repo artifact itself just plain worked without copying over any other classes.

grafik

Thx for an amazing project !