Issue in having a maven local repo dependancy for edb-jdbc jar

2.3k Views Asked by At

I am trying to create a simple maven project in java which connects to EDB and get the records from a table. But i am getting a class not found exception in the line,

Class.forName("com.edb.Driver"); 

In my pom.xml, i am having the following dependancy for edb-jdbc driver.

<dependency> 
<groupId>com.edb.Driver</groupId> 
<artifactId>edb</artifactId> 
<scope>system</scope> 
<systemPath>C:/Users/smgty/DSLConenction/application/src/main/webapp/WEB-INF/lib/edb-jdbc14.jar</systemPath> 
<version>14</version> 
</dependency> 

1) I have also added the edb-jdbc14.jar in the classpath. so when i run the code as a standalone java application, it works fine. 2) using maven, i am doing an maven install which generates the JAR file, and i m running the same using java -cp target/app.jar com.EdbDSL.app.application.App

Can someone help me in getting this working using maven, please.

1

There are 1 best solutions below

0
On

system path has some issues.

so first run maven command like below

   mvn install:install-file -Dfile={Path/to/your/edb-jdbc.jar} 

  -DgroupId=com.edb.Driver 

 -DartifactId=edb -Dversion=14 -Dpackaging=jar

then add dependency in pom as below

<dependencies>>

        <!-- ORACLE database driver -->
        <dependency>
            <groupId>com.edb.Driver</groupId>
            <artifactId>edb</artifactId>
            <version>14</version>
        </dependency>

    </dependencies>