3

This was asked before but did not help because I am using gradle. I have Oracle 12c running in Docker at jdbc:oracle:thin:@//localhost:1521/xe.

In my gradle.build I have the following gradle task:

task('dev') << {
    println "executing dev"
    liquibase {
        activities {
            main {
                changeLogFile changeLog
                url 'jdbc:oracle:thin:@//localhost:1521/xe'
                username 'admin'
                password 'admin'
            }
        }
    }
}

I added two different jars to libs/jdbc-oracle.jar and added compile files('libs/jdbc-oracle.jar') but still got the same error. I am using the gradle liquidbase plugin version classpath "org.liquibase:liquibase-gradle-plugin:1.2.4"

Has anyone had this issue before? How was it resolved?

-------------------Update 1-----------------

I added the following:

compile ("com.oracle:ojdbc7:12.1.0.1") in the buildscript and tried in the dependencies both failed.

Mike3355
  • 11,305
  • 24
  • 96
  • 184
  • Try: `compile fileTree(dir: "lib", include: "*.jar")` – Sascha Frinken Apr 08 '18 at 13:40
  • See https://stackoverflow.com/questions/37458661/how-to-use-oracle-jdbc-driver-in-gradle-project – Ori Marko Apr 08 '18 at 13:45
  • @user7294900 not sure if you read my question because you gave me a post of the solution I already tried. Thank you for the effort. – Mike3355 Apr 08 '18 at 18:13
  • @SaschaFrinken good idea and I just tried it and sadly got the same error. – Mike3355 Apr 08 '18 at 18:24
  • @SaschaFrinken this is a springboot application. I am wondering if I should configure it this route. I know in Jhipster it is done this was if I recall correctly. – Mike3355 Apr 08 '18 at 18:36
  • Did you add this to your buildscript classpath as well? Maybe you should post your complete build.gradle file – Sascha Frinken Apr 08 '18 at 19:29
  • This seems to be a common issue. I've spent the entire afternoon trying to get `diffChangeLog` running. I can't figure out why the task cannot find my SQL Server driver that I've specified on my `buildscript` class path. – jndietz May 16 '18 at 21:53

1 Answers1

0

In this case I had to add the jar manually and use JDBC 7, than add the classpath under main. JDBC 12 gave me errors I found out downgrading should solve the issue here link to post

task('dev') << {
    println "executing dev"
    liquibase {
        activities {
            main {
                changeLogFile changeLog
                classpath 'build/libs/jdbc7.jar'
                url 'jdbc:oracle:thin:@//localhost:1521/xe'
                username 'admin'
                password 'admin'
            }
        }
    }
}
Mike3355
  • 11,305
  • 24
  • 96
  • 184