Skip to content

Commit

Permalink
Replace OCI Java SDK shaded jar with v3 for OCI integration (#5704)
Browse files Browse the repository at this point in the history
* Replace OCI Java SDK shaded jar with v3 for OCI integration

* Set compile scope for jersey 3 httpclient dependency

* Fix parent version for oci atp reactive exzmple

* Remove import that is not needed anymore

* Remove a NOTE pointing to links to oci-compatibility include doc

* Fix httpclient dependency scoping in MP and add httpclient dependency for reactive oci examples including the OCI SE doc
  • Loading branch information
klustria authored Dec 16, 2022
1 parent 5d9c381 commit 2a4044f
Show file tree
Hide file tree
Showing 17 changed files with 118 additions and 383 deletions.
8 changes: 7 additions & 1 deletion dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<version.lib.neo4j>4.4.3</version.lib.neo4j>
<version.lib.netty>4.1.77.Final</version.lib.netty>
<version.lib.netty-io_uring>0.0.8.Final</version.lib.netty-io_uring>
<version.lib.oci>2.45.0</version.lib.oci>
<version.lib.oci>3.0.0</version.lib.oci>
<version.lib.ojdbc8>21.3.0.0</version.lib.ojdbc8>
<version.lib.database.messaging>19.3.0.0</version.lib.database.messaging>
<version.lib.okhttp3>3.14.9</version.lib.okhttp3>
Expand Down Expand Up @@ -1494,6 +1494,12 @@
<version>${version.lib.oci}</version>
<optional>false</optional>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common-httpclient-jersey3</artifactId>
<version>${version.lib.oci}</version>
<optional>false</optional>
</dependency>
<!-- Service modules, alpha sorted -->
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
Expand Down
59 changes: 0 additions & 59 deletions docs/includes/oci.adoc

This file was deleted.

8 changes: 2 additions & 6 deletions docs/mp/integrations/oci.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ include::{rootdir}/includes/mp.adoc[]
== Overview
Helidon MP OCI Integration provides easy access to Oracle Cloud Infrastructure using the OCI Java SDK.
NOTE: OCI SDK uses JAX-RS Client 2.1.6 (javax package names), which makes it incompatible with Helidon 3 applications and any application that uses JAX-RS 3 (jakarta package naming). See <<oci-compatibility, Resolving compatibility issue with OCI SDK>> for detailed information on how to work around this issue.
Helidon MP OCI Integration provides easy access to Oracle Cloud Infrastructure using the OCI Java SDK.`
include::{rootdir}/includes/dependencies.adoc[]
Expand Down Expand Up @@ -137,9 +135,7 @@ Once you have injected an ObjectStorage client you can use it as described in:
* link:{oci-javasdk-objstore-javadoc-base-url}/package-summary.html[OCI SDK Object Storage Javadocs]
* link:{oci-objstore-url}[OCI Object Storage Overview]
include::{rootdir}/includes/oci.adoc[leveloffset=+1]
== References
* link:{integration-oci-sdk-cdi-javadoc-base-url}/io/helidon/integrations/oci/sdk/cdi/OciExtension.html[OciExtension] Javadocs
* link:{helidon-github-tree-url}/examples/integrations/oci[OCI SDK Usage Examples]
* link:{helidon-github-tree-url}/examples/integrations/oci[OCI SDK Usage Examples]
10 changes: 3 additions & 7 deletions docs/se/integrations/oci.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ include::{rootdir}/includes/se.adoc[]
Helidon SE OCI Integration provides easy access to Oracle Cloud Infrastructure using the OCI Java SDK.
NOTE: OCI SDK uses JAX-RS Client 2.1.6 (javax package names), which makes it incompatible with Helidon 3 applications and any application that uses JAX-RS 3 (jakarta package naming). See <<oci-compatibility, Resolving compatibility issue with OCI SDK>> for detailed information on how to work around this issue.
== Usage
It is recommended that you use the OCI Java SDK directly, in particular the Async clients. All you need to do is configure and create an OCI SDK Client object. The configuration primarily
Expand Down Expand Up @@ -64,7 +62,8 @@ You also need to add the following dependency to your application for this
----
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common</artifactId>
<artifactId>oci-java-sdk-common-httpclient-jersey3</artifactId>
<scope>runtime</scope>
</dependency>
----
Expand Down Expand Up @@ -108,11 +107,8 @@ Once you have created an ObjectStorage client you can use it as described in:
* link:{oci-javasdk-objstore-javadoc-base-url}/package-summary.html[OCI SDK Object Storage Javadocs]
* link:{oci-objstore-url}[OCI Object Storage Overview]
include::{rootdir}/includes/oci.adoc[leveloffset=+1]
== References
* link:{helidon-github-tree-url}/examples/integrations/oci[OCI SDK Usage Examples]
* link:https://docs.oracle.com/en-us/iaas/Content/home.htm[OCI Documentation]
]
]
8 changes: 1 addition & 7 deletions examples/integrations/oci/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
# OCI SDK setup for Examples Build

OCI SDK uses JAX-RS Client 2.1.6 (javax package names), which makes it incompatible with Helidon 3 applications and any application that uses JAX-RS 3 (jakarta package naming).

Please see our [Guide](https://github.com/oracle/helidon/tree/master/docs/includes/oci.adoc) for detailed information on how to work around this issue.

Once you have this setup, you can build examples in this repository directory.
# OCI Java SDK Examples
17 changes: 1 addition & 16 deletions examples/integrations/oci/atp-cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@
<name>Helidon Examples Integration OCI ATP CDI</name>
<description>CDI integration with OCI ATP.</description>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
<version>${version.lib.oci}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.helidon.microprofile.bundles</groupId>
Expand All @@ -64,12 +54,7 @@
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<scope>runtime</scope>
<artifactId>oci-java-sdk-database</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.config</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import com.oracle.bmc.database.model.GenerateAutonomousDatabaseWalletDetails;
import com.oracle.bmc.database.requests.GenerateAutonomousDatabaseWalletRequest;
import com.oracle.bmc.database.responses.GenerateAutonomousDatabaseWalletResponse;
import com.oracle.bmc.http.internal.ResponseHelper;
import com.oracle.bmc.http.client.Options;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import jakarta.ws.rs.GET;
Expand Down Expand Up @@ -82,7 +82,7 @@ public class AtpResource {
@GET
@Path("/wallet")
public Response generateWallet() {
ResponseHelper.shouldAutoCloseResponseInputStream(false);
Options.shouldAutoCloseResponseInputStream(false);
GenerateAutonomousDatabaseWalletResponse walletResponse =
databaseClient.generateAutonomousDatabaseWallet(
GenerateAutonomousDatabaseWalletRequest.builder()
Expand Down
16 changes: 3 additions & 13 deletions examples/integrations/oci/atp-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@
<mainClass>io.helidon.examples.integrations.oci.atp.reactive.OciAtpMain</mainClass>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
<version>${version.lib.oci}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.helidon.webserver</groupId>
Expand All @@ -71,11 +61,11 @@
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
<artifactId>oci-java-sdk-database</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common-httpclient-jersey3</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
Expand Down
17 changes: 4 additions & 13 deletions examples/integrations/oci/metrics-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@
<name>Helidon Examples Integration OCI Metrics Reactive</name>
<description>Reactive integration with OCI Metrics.</description>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
<version>${version.lib.oci}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.helidon.webserver</groupId>
Expand All @@ -58,13 +48,14 @@
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
<artifactId>oci-java-sdk-monitoring</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common-httpclient-jersey3</artifactId>
<scope>runtime</scope>
</dependency>

</dependencies>

<build>
Expand Down
18 changes: 1 addition & 17 deletions examples/integrations/oci/objectstorage-cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@
<mainClass>io.helidon.examples.integrations.oci.objectstorage.cdi.ObjectStorageCdiMain</mainClass>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
<version>${version.lib.oci}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.helidon.microprofile.bundles</groupId>
Expand All @@ -55,16 +45,10 @@
<dependency>
<groupId>io.helidon.integrations.oci.sdk</groupId>
<artifactId>helidon-integrations-oci-sdk-cdi</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<scope>runtime</scope>
<artifactId>oci-java-sdk-objectstorage</artifactId>
</dependency>
<dependency>
<groupId>io.helidon.config</groupId>
Expand Down
16 changes: 4 additions & 12 deletions examples/integrations/oci/objectstorage-reactive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,7 @@
<properties>
<mainClass>io.helidon.examples.integrations.oci.objecstorage.reactive.OciObjectStorageMain</mainClass>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
<version>${version.lib.oci}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.helidon.webserver</groupId>
Expand All @@ -56,11 +48,11 @@
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
<artifactId>oci-java-sdk-objectstorage</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-common-httpclient-jersey3</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
Expand Down
22 changes: 7 additions & 15 deletions examples/integrations/oci/vault-cdi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@
<mainClass>io.helidon.examples.integrations.oci.vault.cdi.VaultCdiMain</mainClass>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
<version>${version.lib.oci}</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.helidon.microprofile.bundles</groupId>
Expand All @@ -55,16 +45,18 @@
<dependency>
<groupId>io.helidon.integrations.oci.sdk</groupId>
<artifactId>helidon-integrations-oci-sdk-cdi</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
<artifactId>oci-java-sdk-keymanagement</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<scope>runtime</scope>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-secrets</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-vault</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
Loading

0 comments on commit 2a4044f

Please sign in to comment.