Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

403: Forbidden when attempting to pull ojdbc from Oracle #1

Closed
tjheslin1 opened this issue Oct 22, 2017 · 2 comments
Closed

403: Forbidden when attempting to pull ojdbc from Oracle #1

tjheslin1 opened this issue Oct 22, 2017 · 2 comments

Comments

@tjheslin1
Copy link

I've followed your detailed guide, which has been very helpful at getting further on with my problem of treating the ojdbc as any other external dependency 馃憤

My issue isn't a problem with the guide in this repo, but the solution may be useful to add.

My build.gradle looks like this

Here's a snippet:

repositories {
    jcenter()

    maven {
        url "https://www.oracle.com/content/secure/maven/content"
        credentials {
            username oracleUsername
            password oraclePassword
        }
    }
}

...

compile("com.oracle.jdbc:ojdbc7:12.1.0.2")

I have my Oracle SSO credentials in my gradle.properties and have double-checked they are correct.

My current issue, when running ./gradlew, is the following:

Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve com.oracle.jdbc:ojdbc7:12.1.0.2.
  Required by:
      project :
   > Could not resolve com.oracle.jdbc:ojdbc7:12.1.0.2.
      > Could not get resource 'https://www.oracle.com/content/secure/maven/content/com/oracle/jdbc/ojdbc7/12.1.0.2/ojdbc7-12.1.0.2.pom'.
         > Could not GET 'https://www.oracle.com/content/secure/maven/content/com/oracle/jdbc/ojdbc7/12.1.0.2/ojdbc7-12.1.0.2.pom'. Received status code 403 from server: Forbidden

I tried setting up another Oracle SSO account but had the same problem.
I have also tried putting garbage log-in credentials, which results in a 401: Unauthorized error.

Any insight would be greatly appreciated.

@tjheslin1
Copy link
Author

tjheslin1 commented Oct 29, 2017

I have fixed this issue. The 403 Forbidden is, I believe, due to Oracle not distributing ojdbc7 over maven. They do allow you to download ojdbc8.

Therefore my build.gradle now looks like this:

def oracleUsername = hasProperty('mavenOracleUsername') ? mavenOracleUsername : System.getenv('mavenOracleUsername')
def oraclePassword = hasProperty('mavenOraclePassword') ? mavenOraclePassword : System.getenv('mavenOraclePassword')

repositories {
    jcenter()

    maven {
        url "https://www.oracle.com/content/secure/maven/content"
        credentials {
            username "${oracleUsername}"
            password "${oraclePassword}"
        }
    }
}

...

dependencies {
    compile group: 'com.oracle.jdbc', name: 'ojdbc8', version: '12.2.0.1'
}

@tjheslin1
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant