scala - Using jooq-sbt-plugin with ojdbc -
i'm using jooq. solving issue jooq-sbt-plugin
config (here) resulted in classpath issue think separate original one. managed configuration work trying play oracle drivers seems impossible.
the issue here plugin seems run own java
process , hence required classpath (with odbc14.jar
in it) never passed on. there way plugin work? couldn't figure out how inject plugin's classpath.
the workaround can come defining task instead (described here: https://gist.github.com/chris-martin/5140754).
any appreciated. thanks.
2013-09-10 update
here's config:
import sbt._ import keys._ import jooqplugin._ object samplebuild extends build { lazy val = project(id = "all", base = file("."), settings = defaultsettings) aggregate( one, 2 ) lazy val 1 = project( id = "one", base = file("one"), settings = defaultsettings ++ seq( librarydependencies ++= dependencies.one ) ) lazy val 2 = project( id = "two", base = file("two"), settings = defaultsettings ++ jooqsettings ++ customjooqsettings ++ seq( librarydependencies ++= dependencies.two ) ) dependson (one) override lazy val settings = super.settings ++ buildsettings lazy val buildsettings = seq( organization := "org.sample", version := "0.1-snapshot", scalaversion := "2.10.2" ) lazy val defaultsettings = defaults.defaultsettings ++ seq( scalacoptions in compile ++= scalacparams, externalresolvers in compile := resolvers.commonresolvers, shellprompt := shellprompt.buildshellprompt, resolvers ++= resolvers.commonresolvers ) lazy val customjooqsettings = seq( jooqoptions := jooqbvpoptions, jooqoutputdirectory := new java.io.file("../src/appdb/src/main/java") ) lazy val jooqbvpoptions = seq( "jdbc.driver" -> "oracle.jdbc.oracledriver", "jdbc.url" -> "jdbc:oracle:thin:@//<some server>", "jdbc.user" -> "<some user>", "jdbc.password" -> "<some pwd>", "generator.database.name" -> "org.jooq.util.oracle.oracledatabase", "generator.database.inputschema" -> "<some schema>", "generator.database.includes" -> "table1|table2|table3", "generator.target.packagename" -> "org.example.generated") } object resolvers { /* ... */ } object dependencies { /* ... */ } object shellprompt { /* ... */ }
and here's error:
[info] initialising properties : /jooq-config2705409947508036761.xml [error] cannot read /jooq-config2705409947508036761.xml. error : oracle.jdbc.oracledriver [error] java.lang.classnotfoundexception: oracle.jdbc.oracledriver [error] @ java.net.urlclassloader$1.run(urlclassloader.java:202) [error] @ java.security.accesscontroller.doprivileged(native method) [error] @ java.net.urlclassloader.findclass(urlclassloader.java:190) [error] @ java.lang.classloader.loadclass(classloader.java:306) [error] @ sun.misc.launcher$appclassloader.loadclass(launcher.java:301) [error] @ java.lang.classloader.loadclass(classloader.java:247) [error] @ java.lang.class.forname0(native method) [error] @ java.lang.class.forname(class.java:171) [error] @ org.jooq.util.generationtool.main(generationtool.java:269) [error] @ org.jooq.util.generationtool.main(generationtool.java:123) [error] usage : generationtool <configuration-file> [trace] stack trace suppressed: run last appdb-tool/jooq:codegen full output. [error] (appdb-tool/jooq:codegen) failed return code: 255 [error] total time: 1 s, completed sep 10, 2013 1:45:24 pm
jooq-sbt-plugin's readme says:
add database driver list of
librarydependencies
"jooq" scope:librarydependencies += "mysql" % "mysql-connector-java" % "5.1.22" % "jooq"
you left out dependencies.two
in above excerpt, maybe you're missing that.
Comments
Post a Comment