Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

[OR-322] - Include Oracle JDBC driver in package #291

Merged
merged 12 commits into from
Sep 29, 2019
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ version.txt

### Gradle ###
.gradle
gradle.properties
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a gradle.properties at the root of Orion to now ignore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gradle.properties is used by gradle to read personal project properties which we don't want to commit to git (in our case Oracle maven user and password). Hence, it is in ignore list.



### IntelliJ ###
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Instructions for how to get started with developing on the Orion codebase. Pleas
[contribution guidelines](CONTRIBUTING.md) for more detail on how to submit a pull request (PR).

* [Machine Setup](docs/development/machine_setup.md)
* [Oracle Maven Repo Credentials for JDBC Driver](docs/development/oracle_jdbc.md)
* [Checking Out and Building](docs/development/building.md)
* [Running Developer Builds](documentation/development/running_developer_builds.md)
* [Code Coverage](docs/development/code-coverage.md)
Expand Down
21 changes: 20 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,21 @@ openjpa {

//////
// Dependencies

repositories {
jcenter()
maven { url "https://consensys.bintray.com/consensys" }
//for Oracle JDBC Driver
maven {
//following url is a workaround, the actual maven repo url is meant to be https://maven.oracle.com which
//gradle unable to handle due to circular redirect
// The Oracle jdbc jars should get downloaded at: ~/.gradle/caches/modules-2/files-2.1/com.oracle.jdbc
url "https://www.oracle.com/content/secure/maven/content"
content { includeGroup "com.oracle.jdbc" }
credentials {
username project.properties.oracleMavenUser
password project.properties.oracleMavenPassword
}
}
}

dependencies {
Expand Down Expand Up @@ -280,6 +291,14 @@ dependencies {
// XML
compile 'javax.xml.bind:jaxb-api'

//Oracle JDBC
if(project.hasProperty("oracleMavenUser")) {
compile('com.oracle.jdbc:ojdbc10') { transitive = false }

compile('com.oracle.jdbc:ucp') { transitive = false //because ucp pom declares both ojdbc8 and ojdbc10 incorrectly
}
}

// testing
testCompile 'com.h2database:h2'
testCompile 'org.junit.jupiter:junit-jupiter-api'
Expand Down
16 changes: 16 additions & 0 deletions docs/development/oracle_jdbc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Oracle Maven Access
* Orion bundles Oracle JDBC driver which is downloaded from Oracle Maven repository by Gradle.
* You need to provide your Oracle account credentials to access Oracle Maven repository.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reading of this line suggests this PR is introducing a dependency on having a OTN account to build Orion, is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CjHare It is partially correct now that I am re-reading it. The Orion would still build without Oracle JDBC if we don't create project properties. It needs to be re-worded as Orion can optionally bundle JDBC driver...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but your point is correct, this PR is introducing a dependency on having an Oracle account in order to bundle Oracle JDBC driver

If you don't have Oracle credentials, you can create one at
https://profile.oracle.com/myprofile/account/create-account.jspx
* Create (or update) `gradle.properties` in project root folder and add following
gradle properties
```
oracleMavenUser=YourOracleAccountEmail
oracleMavenPassword=YourOracleAccountPassword
```
* Instead of modifying `gradle.properties`, following environment variables can also be used
```
ORG_GRADLE_PROJECT_oracleMavenUser
ORG_GRADLE_PROJECT_oracleMavenPassword
```
14 changes: 13 additions & 1 deletion gradle/check-licenses.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ext.acceptedLicenses = [
'Eclipse Public License 2.0',
'The MIT License',
'Unicode/ICU License',
'Oracle Technology Network License Agreement - Oracle Maven Repository',
]*.toLowerCase()

/**
Expand Down Expand Up @@ -77,6 +78,10 @@ downloadLicenses {
ext.mit = license(
'The MIT License',
'https://opensource.org/licenses/MIT')
ext.otn = license(
'Oracle Technology Network License Agreement - Oracle Maven Repository',
'https://www.oracle.com/webapps/maven/register/license.html'
)

aliases = [
(apache2): [
Expand Down Expand Up @@ -135,6 +140,9 @@ downloadLicenses {
'MIT license',
'MIT License',
],
(otn): [
'Oracle Technology Network License Agreement - Oracle Maven Repository'
]
]

licenses = [
Expand All @@ -149,7 +157,11 @@ downloadLicenses {
(group('org.checkerframework')): mit,

// Explicitly declare CDDL1.1 license for javax.xml.bind APIs
(group('javax.xml.bind')): cddl1_1
(group('javax.xml.bind')): cddl1_1,

// Oracle JDBC Driver license
(group('com.oracle.jdbc')): otn

]
}

Expand Down
3 changes: 3 additions & 0 deletions gradle/versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ dependencyManagement {
dependency 'com.squareup.okhttp3:mockwebserver:3.10.0'
dependency 'com.squareup.okhttp3:okhttp:3.10.0'

dependency 'com.oracle.jdbc:ojdbc10:19.3.0.0'
dependency 'com.oracle.jdbc:ucp:19.3.0.0'

dependency 'io.gatling.highcharts:gatling-charts-highcharts:2.3.1'
dependency 'io.gatling:gatling-app:2.3.1'
dependency 'io.gatling:gatling-core:2.3.1'
Expand Down