0

error: Could not resolve dependencies for project com.ctl.project:jar:1.0.0: Failed to collect dependencies at com.oracle:ojdbc7:jar:12.1.0.1

I am using latest version sql developer 20.4.1.407.0006 but in that project 19.2.1.247.2212 version was used. Is that will be the problem for this error

Selvi
  • 1
  • 1
  • Does this answer your question? [problems trying to install ojdbc7 as a maven dependency](https://stackoverflow.com/questions/59584499/problems-trying-to-install-ojdbc7-as-a-maven-dependency) – crizzis Apr 19 '21 at 15:36

1 Answers1

0

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.

Big Ed
  • 1,056
  • 9
  • 20