1

Currently I am learning Nexus and gradle integration and stuck with one issue.

One file OJDBC14.jar is has already been uploaded on nexus earlier. So when we mentioned that jar in build.gradle dependency, it downloads from nexus. OJDBC14

dependencies {
compile 'mysql:mysql-connector-java:8.0.9-rc'
compile 'ojdbc:ojdbc:14'
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.5'
compile 'org.apache.poi:poi:4.0.0'
compile 'org.apache.poi:poi-ooxml:4.0.0'
compile 'com.aventstack:extentreports:3.1.2'
compile 'org.jsoup:jsoup:1.11.3'
compile 'com.google.code.gson:gson:2.8.5'
compile 'com.sparkjava:spark-core:2.8.0'
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.0'}

Recently I have uploaded new jar file OJDBC8.jar on nexus using UI but build.gradle cannot download that file from nexus. OJDBC8

dependencies {
compile 'mysql:mysql-connector-java:8.0.9-rc'
compile 'ojdbc:ojdbc:14'
compile 'ojdbc:ojdbc:8'
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.5'
compile 'org.apache.poi:poi:4.0.0'
compile 'org.apache.poi:poi-ooxml:4.0.0'
compile 'com.aventstack:extentreports:3.1.2'
compile 'org.jsoup:jsoup:1.11.3'
compile 'com.google.code.gson:gson:2.8.5'
compile 'com.sparkjava:spark-core:2.8.0'
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.0'}

I checked the .gradle log but it does not showing any error message.

Is there any other settings to do when we upload the jar using UI?

M.Ricciuti
  • 11,070
  • 2
  • 34
  • 54

1 Answers1

1

You are trying to add two different versions of the same module ojdbc:ojdbc for the same configuration compile, but this is not supported by Gradle, see more details about dependencies resolution here. In your case, unless you change the default resolution strategy, the latest version of this module will be used, so version 14.

So I think your issue is not connected to this particular library version 8 in your Nexus: you can try to remove/comment the dependency compile 'ojdbc:ojdbc:14' and keep only compile 'ojdbc:ojdbc:14': Gradle should be able to download/use this version 8.

M.Ricciuti
  • 11,070
  • 2
  • 34
  • 54