I am totally new to everything in Java and it gets confusing some times, for example I want to follow some example to learn about Jersey. So I go to their webiste and for Core-Server they say include this in your POM, which is using version 1.2 http://jersey.java.net/nonav/documentation/latest/user-guide.html#chapter_deps
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.12</version>
</dependency>
Then I look at some other examples online and they say include this, using version 1.8
<repositories>
<repository>
<id>maven2-repository.java.net</id>
<name>Java.net Repository for Maven</name>
<url>http://download.java.net/maven/2/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.8</version>
</dependency>
</dependencies>
So I guess my main question is what is the correct way of finding these Maven coordinates ans to know what is the correct version number to use?
You should use the version you need.
What you need is determined by what you’re doing. If you’re following a tutorial letter-by-letter, use the version from the tutorial. To further your knowledge immediately after, try upgrading to the latest version, making use of new features etc.
In general you’ll want to use the latest version of a library–unless doing do would break compatibility with a different dependency. You can manage all that through Maven via dependency excludes. You may also want to read this intro as well).
If you’re using any given library you likely know its homepage, which will brag about the latest version… usually. If you know the group and artifact you can also look on mvnrepository.com (for example).
In this case, there are 2.x milestones, and the current 1.x release, 1.13.