Coder Social home page Coder Social logo

Comments (3)

Carleslc avatar Carleslc commented on July 23, 2024

This is not a Simple-YAML bug; it is a known issue related to a dependency clash between Velocity and Simple-YAML.

Velocity uses an older version of snakeyaml (1.26) than this library requires (1.30 or above, latest version uses 1.32). Because of this, there is a dependency clash, so even if the correct version is built with maven into your plugin through Simple-Yaml, in runtime at the moment of loading your plugin the first loaded version prevails, which sadly happens to be the older one loaded by the Velocity server.

See this comment to read a more detailed explanation for the error and the solution, which is relocation to differentiate both versions in runtime using different classpaths.

Example of maven-shade-plugin using relocation to solve the error:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-shade-plugin</artifactId>
  <version>3.4.1</version>
  <executions>
    <execution>
      <goals>
        <goal>shade</goal>
      </goals>
      <configuration>
        <relocations>
          <relocation>
            <pattern>org.yaml.snakeyaml</pattern>
            <shadedPattern>net.servidor.commons.libs.snakeyaml</shadedPattern>
          </relocation>
        </relocations>
      </configuration>
    </execution>
  </executions>
</plugin>

from simple-yaml.

Carleslc avatar Carleslc commented on July 23, 2024

Since 1.8.3 the manual relocation is not needed as it is already included.
Add the relocation in 1.8.2 or update to 1.8.3.
I'm closing the issue. Comment if you have any doubts.

from simple-yaml.

thelipe7 avatar thelipe7 commented on July 23, 2024

Thanks :)

from simple-yaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.