> What could be the problem?
I see a (probably unrelated) problem: SNAPSHOT versions are
work-in-progress, which you probably don't want. Even if you wanted the
latest, bleeding-edge, cut-yourself version, it's probably not a good
idea to use them if you aren't familiar with Maven yet. (BTW consider
Gradle instead. Maven isn't particularly suitable for small team sizes.)
> when I try to create a YAML object I got the
> following error: java.lang.NoClassDefFoundError:
> org/yaml/snakeyaml/Yaml.
This kind of thing shouldn't possibly happen if the build is done with
Maven.
Is Maven run? It should be emitting quite a lot of messages on the
console. If you're using an IDE, you need to tell the IDE that it should
use Maven, otherwise you can build and run your application on the
command line but the IDE will not know that it should use the .jars
provided by Maven. In Eclipse, this means installing m2e and converting
your project to a Maven project. Or maybe set up a new Maven project and
move your code over - m2e is pretty intrusive and expects a lot of
things about what subdirectory holds what kinds of sources, like this:
src/main/java/ - application code, all .java files
src/main/resources/ - anything non-.java for the application
src/test/java/ - automated test code, all .java files
src/test/resources/ - anything non-.java for the automated tests
More elaborate directory structures do exist, but most projects
(including highly professionals) aren't even aware of that.
https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
will give you an idea of what variations exist; plugins may define more
standard directory but usually do not.
> However, even if there are the .jar files in ~/.m2,
These are automatically downloaded there whenever you run Maven, so you
don't need to worry about whether they're present there or not.
Inspecting .m2/ is useful to verify that a download did happen; the
usual approach is to kill the directory (or just the .jar you're
interested in) and see whether it downloads again.
(This is usually frowned upon by the administrators of the repository,
because they all have huge day-per-day download bandwidth and pay per
gigabyte, so this is something that one shouldn't do unless one has a
reason to.)
HTH
Jo