How to add Maven dependency from a relative path referencing a local jar

When you want to add a dependency which is not stored in maven repositories to your project this is the way!! You can manually download it and include inside the project and refer it from the pom.xml through a relative path.

This example assumes that you have downloaded and stored the jar inside ${project}/src/test/resources/lib. 
       <dependency>
                <groupId>ojdbc</groupId>
                <artifactId>ojdbc6</artifactId>
                <scope>system</scope>
                <version>6</version>
                <systemPath>${basedir}/src/test/resources/lib/ojdbc6.jar</systemPath>
        </dependency>
Here we must specify the scope of the dependency  as 'system'. There is another way which is to manually install the maven dependency to your local repository. You can find out how from here.

Comments

  1. Superb information, as always. After reading this one I really got refreshing and fantastic feeling! This is also a great and encouraging post.
    spring hibernate training in chennai
    java training in chennai velachery

    ReplyDelete
  2. Great article with an excellent idea!Thank you for such a valuable article. I really appreciate for this great information
    Best DOT NET Training institute in Chennai
    DOT NET Training Chennai

    ReplyDelete

Post a Comment

Popular posts from this blog

PHP-SOAP web service with out a WSDL

Manually install a maven dependency