Oracle hasn't made its ojdbc drivers available through public Maven repositories in the past, so I don't think you can resolve it that way. I believe that they want to force you to accept a license agreement before you can get them.
I solved the problem for myself by putting them in a file-based Maven repository on my intranet. Here is my build.gradle script, which may be a little more complicated than you need.
/**********************************************************************/
/* Deploy OJDBC Jar File to Maven server */
/**********************************************************************/
apply plugin: 'maven'
def version = '11.6';
ext {
currentUpload = System.env.TARGET_ARTIFACT
assert currentUpload?.size()
jarFile = new File("lib/${currentUpload}.jar")
jarVersion = currentUpload.replaceAll(/.*-/,'');
groupMappings = ["ojdbc7-1.0": "edu.sunyjcc.oracle",
"ojdbc8-1.0": "edu.sunyjcc.oracle"]
}
println "Current branch is ${currentUpload}."
// Add branch to current version if it isn't production.
project.version = jarVersion
assert groupMappings.containsKey(currentUpload);
project.group = groupMappings[currentUpload];
configurations {
allJars
}
artifacts {
allJars file(jarFile)
}
/**********************************************************************/
/* Deploy to Maven server */
/**********************************************************************/
task verifyJarFile() {
println "***********************************************************"
// println "* currentGitBranch $currentGitBranch";
println "* currentUpload $currentUpload";
println "* jarFile $jarFile";
println "* jarVersion $jarVersion";
println "* group ${groupMappings[currentUpload]}";
println "***********************************************************"
assert jarFile.exists();
}
uploadAllJars {
repositories {
mavenDeployer {
repository(url: "file://x:/source/mvn")
}
}
}
uploadAllJars.dependsOn "verifyJarFile"
task deploy
deploy.dependsOn uploadAllJars
I keep all of the jar files in the lib directory of the project, and set the TARGET_ARTIFACT environment variable to choose which one I want to build.
HTH,
Ed.