Closed Ajneb97 closed 2 years ago
Not a bug. You have a dependency clash with snakeyaml (required in both Simple-YAML and Velocity). Velocity uses an older version of snakeyaml than the required in Simple-YAML, and maven is selecting the older version probably because finds it first in the dependency tree. I don't know if you have the latest version of Velocity and if they have upgraded the snakeyaml to at least version 1.30.
Check issue #57 for help on how to solve the version clash.
I fixed it, but I had to add the snakeyaml 1.30 dependency manually to maven, because another error appeared. It seems Simple-YAML is not using the latest version.
Simple-Yaml 1.8 uses snakeyaml 1.30, which is the latest version of snakeyaml. Velocity 3.1.1 uses snakeyaml 1.26. Adding the snakeyaml 1.30 dependency in your pom along with Simple-Yaml 1.8 should be enough to resolve the version conflict.
The new error seems the same problem anyway, due to the same version clash of snakeyaml. Both setIndentWithIndicator and setProcessComments methods were introduced in snakeyaml 1.28. If those methods are not found that means that maven is still selecting the wrong version.
I see you've done some relocation, maybe you have both versions around and still conflicting. Check it with mvn dependency:tree -Dverbose
Try the other options provided in the issue #57 (dependencyManagement and snakeyaml exclusion inside the Velocity dependency tag).
Thx it is fixed now.
What configuration did resolve the issue for you? Exclusion? Or was something related to relocation?
Relocation and I had to manually add snakeyaml 1.30 to maven
`
<artifactId>snakeyaml</artifactId>
<version>1.30</version>
`
I am trying to create a config file using the following method:
YamlFile yamlFile = new YamlFile("config.yml");
but I get an error on that line, telling me that there is a missing method from snakeyml. I am using the latest version of Simple-YAML with maven, and Velocity.