简体   繁体   中英

Maven build fails with ojdbc6.jar but works with ojdbc7.jar

We are converting one of our existing enterprise application to a maven project. To keep the changes minimal we have decided to reuse all existing jars from the existing application by installing them manually in local repo instead of downloading them from global repository. This application has worked fine over the years when ear was exported from RAD/ECLIPSE. This application currently uses ojdbc6.jar. However, after converting to maven project when we run maven build ,we get the following compilation error for one of the class:

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-
    plugin:2.3.2:compile (default-compile) on project OLS: Compilation 
    failure: Compilation failure:
    [ERROR] \workspace_maven\Project\src\com\datalayer\MyConnection.java:
    [601,0] error: myOracleCachedRowSet is not abstract and does not 
    override abstract method <T>getObject(String,Class<T>) in ResultSet

The MyConnection.java file has an inner class myOracleCachedRowSet class extending OracleCachedRowset class and implements RowSet interface. We are using ibm specific JDK 7 and maven version 3.3.9. However, when I switched to ojdbc7.jar that time this compilation error does not come in maven build. But as I said before, this build works fine from eclipse/RAD without Maven using ojdbc6 jar. So I am wondering how this maven build is connected to ojdbc jar version. Where is the connection between the two. Can anyone help? ALso note, since we are using oracle 11g, I don't think we can switch to ojdbc7 jar since that is used for oracle 12c database.

you can add ojdbc6.jar file into local .m2 folder and use dependency into POM.xml. you can use this:

mvn install:install-file -Dfile=/home/user/Libraries/ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11g -Dpackaging=jar

and you can use following dependency into POM.xml.

    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>11g</version>
    </dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM