简体   繁体   中英

Oracle ojdbc driver over Jenkins shared library

I have this Jenkins shared library which I try to use Ojdbc

//@GrabResolver(name = 'Geomajas', root = 'http://maven.geomajas.org/')
//@Grab('com.oracle.jdbc:ojdbc14:10.2.0.1.0')
@Grab('com.oracle.ojdbc:ojdbc8:19.3.0.0')

def call(Map config = [:]) {
    println("validating...")
    try {
        println("loading class")
        //step1 load the driver class
        Class.forName("oracle.jdbc.driver.OracleDriver")

    } catch (Exception e) {
        e.printStackTrace()
        echo "Failed for $e"
    }
}

and the console it keeps throwing

Failed for java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

is there a way to use it in Jenkins shared library?

Can you make sure if you are providing the Maven co-ordinates properly and pointing to central maven (root?)?

<groupId>com.oracle.database.jdbc</groupId>
 <artifactId>ojdbc8</artifactId>
 <version>19.3.0.0</version>

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