Reputation: 3337
I was not able to use the new jar files immediately, had to do mvn install several times and finally all the jar files are showed up in the project.
what could be the problem? Is it not updating the class path correctly?
My questions are:
Edit: Attached the screenshot of the repository
Edit2: i picked the wrong project type. Once i picked webapp archetype, it puts all dependencies in "Maven Dependencies". This is related to my second question.
Upvotes: 0
Views: 115
Reputation: 2790
After you create project use can use this command
mvn eclipse:eclipse -Dwtpversion=2.0
then install m2eclipse
from eclipse marketplace. What I am doing generally is right click eclipse, import/import new maven project and choose my new maven project. Afer import if you dont see your jar folder under Libraries node of project tree, then right click build path/libraries/add class path and choose related folder.
If your library not available in current repository you can use another external repository with below tag: (jboss and java.net repos are very common)
<repositories>
<repository>
<id>java.net2</id>
<url>https://repository.jboss.org/nexus.</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
Upvotes: 0
Reputation: 607
For your question 3 : You can add any public maven repositories in to your pom file which contains your required jar files.
http://forum.springsource.org/showthread.php?63612-Maven-repository-location
or else if you have that jar file in your local machine you can manually install it into maven repository.
mvn install:install-file -Dfile=<path-to-file> -DgroupId=group-id
-DartifactId=artifact-id -Dversion=version -Dpackaging=packaging
As per the Guide to installing 3rd party JARs.
For your 2nd question you can use:
http://maven.apache.org/plugins/maven-dependency-plugin/
Upvotes: 1
Reputation: 2003
If you are using m2eclipse, be sure to right click on the project, select Maven and then "Update project configuration". That should be enough. I assume that you added the Maven project nature already.
Upvotes: 0