Search This Blog

Tuesday, August 23, 2011

Adding external Dependency jar in A Maven project -java via Eclipse/Springsource

Hi,

I was facing a lot of problems when adding an external dependency like jar files in a Maven project.
Here are the steps that I have figured out:

1. Download the required jar.
2. Open the pom.xml (in eclipse or SpringSource or any text editor)
3. Add the following entry:
Group ID : Any suitable group ID
Artifact ID : Any Suitable ID
Version : Apropriate
type : Jar
Scope : System
Path : The path where the jar is saved along with the jar name. Eg /home/ubuntu/Downloads/abc.jar
4. Save the pom file.
5. Right click the POM file -> run as -> Maven generate sources
6. Right click the POM file -> run as -> Maven install
7. Done!

Happy coding!
Shoeb

Class not found Exception for com.mysql.jdbc.Driver

Hi,

When ever the ClassNotFoundException for com.mysql.jdbc.Driver,
make sure you have added the mysql-connector-java-5.1.17.jar (available on mysql site) in the jre/lib/ext directory.
I was using it with my maven build Spring MVC project and was cursing it unnecessarily.

Happy coding,
Shoeb