{"id":2282,"date":"2017-04-29T04:27:41","date_gmt":"2017-04-29T04:27:41","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=2282"},"modified":"2017-04-29T16:38:10","modified_gmt":"2017-04-29T16:38:10","slug":"importing-dependency-jar-file-from-local-directory","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/importing-dependency-jar-file-from-local-directory\/","title":{"rendered":"Importing dependency JAR file to Local Directory"},"content":{"rendered":"<p>There may be times direct access to JAR files are not allowed due to license restrictions.In such case declaring dependency in POM.xml has no effect. In such case the jar files should be manually downloaded and copied to maven local repository so while defining dependency in POM.xml it would take from mavens local repository<\/p>\n<p>In Terminal<\/p>\n<pre>\r\n$ mvn install:install-file -Dfile={Path\/ojdbc6.jar}\r\n      -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar\r\n<\/pre>\n<p>In my case I have downloaded the file to <strong>Downloads<\/strong> Directory<\/p>\n<pre>\r\n mvn install:install-file -Dfile=C:\\\\Downloads\\\\ojdbc14.jar\r\n           -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0 -Dpackaging=jar\r\n<\/pre>\n<p>On executing the above command it would be copied to maven .m2 local repository <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/codethataint.com\/blog\/wp-content\/uploads\/2017\/04\/MavenImport.png\" alt=\"\" width=\"833 \" height=\"169\"\/><\/p>\n<p>Now the above will add the file to maven local repository.This should be followed by definition in pom.xml for dependency<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;dependencies&gt;  \r\n\r\n  \t&lt;dependency&gt;\r\n            &lt;groupId&gt;com.oracle&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;ojdbc14&lt;\/artifactId&gt;\r\n            &lt;version&gt;12.1.0&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n   &lt;\/dependencies&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>There may be times direct access to JAR files are not allowed due to license restrictions.In such case declaring dependency in POM.xml has no effect. In such case the jar files should be manually downloaded and copied to maven local repository so while defining dependency in POM.xml it would take from mavens local repository In&hellip; <a href=\"https:\/\/codethataint.com\/blog\/importing-dependency-jar-file-from-local-directory\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[215],"tags":[],"class_list":["post-2282","post","type-post","status-publish","format-standard","hentry","category-maven"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/2282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=2282"}],"version-history":[{"count":5,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/2282\/revisions"}],"predecessor-version":[{"id":2291,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/2282\/revisions\/2291"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=2282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=2282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=2282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}