Depends on the file pom.xml
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
Don’t forget to pass the file path correctly
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
try {
Map<String, String> map = mapper.readValue(new File("guilds.yaml"), Map.class);
System.out.println(ReflectionToStringBuilder.toString(mapToStringStyle.MULTI_LINE_STYLE));
System.out.println(map.get("id"))
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
The site will not provide a complete solution for you, try to put some code and exemplify the part where you are in trouble. The site people will try to help you.
– Alexandre Cavaloti