I am new to Maven and I am currently using the m2e plugin for Eclipse.
Question 1:
When searching for an artifact (atmosphere-runtime) in the default central repository (right click project: Maven -> add dependancy), a list of results is returned.
However upon adding the dependency I receive the following error message:
Missing artifact org.atmosphere:atmosphere-runtime:bundle:1.0.2
If I search for the artifact on the maven web site I am able to find and download the jar manually (see here). I have tried cleaning/updating/reloading the project, updating/reindexing/rebuiling the central maven repo and restarting Eclipse, but nothing seems to help.
Is there a reason why I am getting this error?
Question 2:
A tutorial I am following suggested adding the following repositories to the pom to download the above artifact:
<repositories>
<repository>
<id>Sonatype snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<repository>
<id>Sonatype releases</id>
<url>https://oss.sonatype.org/content/repositories/releases</url>
</repository>
</repositories>
This works and I am able to download the required artifacts if I manually specify the dependencies in the pom.xml file.
However, if I try and search for the artifacts using the eclipse search (right click project: Maven -> add dependancy), no results are returned from the two new repositories.
Is it possible to include these two new repositories in the search?
For your 1st question. Maven central has only a "jar" but you seemed to be requiring a bundle instead. So you have to change your dependency to "jar" which means to define the dependency like this:
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>1.0.2</version>
</dependency>
instead of:
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>1.0.2</version>
<type>bundle</type>
</dependency>
The best thing to solve the problem in your 2nd Question is to use a repository manager like Nexus and define those two repositories in the repository manager. The https://oss.sonatype.org/content/repositories/snapshots defines the SNAPSHOT's of artifacts which are in Maven Central whereas the second one is the repository which is regularly synchronized into Maven Central. So in my opinion you don't need those two repository separately. If you want to search the content of the two above repositories you can use the search of that: https://oss.sonatype.org/ where you have the access to a Nexus repository which can be used for searching as well.