【发布时间】:2016-09-24 07:52:59
【问题描述】:
我是 Gradle 项目的新手,我有一个问题。我在互联网上搜索过,但找不到我需要的东西,或者我不知道如何搜索它。 首先我要告诉你我的情况。我有一个 Gradle 项目,我想在未来使用 jenkins 执行几个自动化测试,但现在我想尝试 Eclipse。 我在 /lib 目录中有 oracle jdbc 驱动程序,这是我的 build.gradle
apply plugin: 'java'
// In this section you declare where to find the dependencies of your project
repositories {
jcenter()
//mavenCentral()
}
// In this section you declare the dependencies for your production and test code
dependencies {
compile 'org.slf4j:slf4j-api:1.7.21'
compile 'org.seleniumhq.selenium:selenium-java:2.+'
compile 'org.testng:testng:6.+'
//compile 'com.oracle:ojdbc14:10.2.0.4.0'
//testCompile 'net.sourceforge.jexcelapi:jxl:2.6.12'
testCompile 'info.cukes:cucumber-core:1.+'
testCompile 'info.cukes:cucumber-java:1.+'
testCompile 'info.cukes:cucumber-junit:1.+'
testCompile 'junit:junit:4.12'
}
repositories {
flatDir(dir: 'libs')//, name: 'Local libs'
}
dependencies {
compile name: 'ojdbc7'
}
我想在一个类中使用这个 jdbc 驱动程序,但我不知道如何使用它。当我尝试使用 Maven 时,我使用了这种方式“import oracle.jdbc.driver.OracleDriver;”但我想这对 Gradle 项目无效。 你能帮我吗? 提前致谢
【问题讨论】:
标签: jdbc gradle build.gradle ojdbc