Skip to content

Commit

Permalink
Undo manual shaded jar tasks (#4619)
Browse files Browse the repository at this point in the history
* Undoes workarounds for OCI shaded jar

Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
  • Loading branch information
ljnelson authored Jul 28, 2022
1 parent c231797 commit 75b1efe
Show file tree
Hide file tree
Showing 26 changed files with 35 additions and 412 deletions.
2 changes: 1 addition & 1 deletion dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,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.35.0</version.lib.oci>
<version.lib.oci>2.37.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
18 changes: 3 additions & 15 deletions docs/includes/oci.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,9 @@ ifndef::rootdir[:rootdir: {docdir}/..]
With Helidon 3, we are now implementing the MicroProfile 5 Platform and selected Jakarta EE 9.1 specifications. We are also going away from javax.* packages and fully embracing jakarta.* package.
However, the current release 2.35.0 of OCI Java SDK is still using javax.* packages which created compatibility issues e.g. Helidon 3 uses JAX-RS 3.0.0 (jakarta package names) and the corresponding Jersey implementation. OCI SDK 2.35.0 uses JAX-RS Client 2.1.6 (javax package names) and the corresponding Jersey implementation. Therefore, the OCI SDK is incompatible with Helidon 3 applications and any application that uses JAX-RS 3. We have filed an issue with OCI SDK team, see https://github.com/oracle/oci-java-sdk/issues/371 for details on this.
However, the current release 2.37.0 of OCI Java SDK is still using javax.* packages which created compatibility issues e.g. Helidon 3 uses JAX-RS 3.0.0 (jakarta package names) and the corresponding Jersey implementation. OCI SDK 2.37.0 uses JAX-RS Client 2.1.6 (javax package names) and the corresponding Jersey implementation. Therefore, the OCI SDK is incompatible with Helidon 3 applications and any application that uses JAX-RS 3. We have filed an issue with OCI SDK team, see https://github.com/oracle/oci-java-sdk/issues/371 for details on this.
OCI SDK team has provided us with `shaded` jar as workaround as mentioned in the issue. However, this jar is not available in maven-central as of now. See issue https://github.com/oracle/oci-java-sdk/issues/410 for details on that, so user will have to do manual setup/install of this `shaded` jar. You only have to do this once per version of SDK.
* Download OCI SDK from https://github.com/oracle/oci-java-sdk/releases/download/v2.35.0/oci-java-sdk-2.35.0.zip
* Unzip the SDK
[source,bash]
----
unzip -j -p oci-java-sdk-2.35.0.zip shaded/lib/oci-java-sdk-full-shaded-2.35.0.jar > oci-java-sdk-shaded-full-2.35.0.jar
----
* Install `shaded` jar in your local maven repo, see https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
[source,bash]
----
mvn -N org.apache.maven.plugins:maven-install-plugin:install-file -Dfile=oci-java-sdk-shaded-full-2.35.0.jar -DlocalRepositoryPath="~/.m2/repository" -DgroupId=com.oracle.oci.sdk -DartifactId=oci-java-sdk-shaded-full -Dversion=2.35.0 -Dpackaging=jar
----
OCI SDK team has provided us with `shaded` jar as workaround as mentioned in the issue.
Now, when you want to use modules from OCI SDK in your application, instead of using individual modules as defined in our OCI integration documentation, you need to use `full shaded` jar.
Expand All @@ -46,7 +34,7 @@ Now, when you want to use modules from OCI SDK in your application, instead of u
<dependency>
<groupId>com.oracle.oci.sdk</groupId>
<artifactId>oci-java-sdk-shaded-full</artifactId>
<version>2.35.0</version>
<version>2.37.0</version>
</dependency>
----
Expand Down
12 changes: 2 additions & 10 deletions etc/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,12 @@
# Setup error handling using default settings (defined in includes/error_handlers.sh)
error_trap_setup

# Load OCI-related functions. WS_DIR is already defined, so there is
# no need to pass arguments.
. $(dirname -- "${SCRIPT_PATH}")/includes/oci.sh

mvn ${MAVEN_ARGS} --version

# Install OCI shaded full jar, if necessary. This is an idempotent
# call.
install_oci_shaded_full_jar

mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml \
clean install -e \
-Dmaven.test.failure.ignore=true \
-Pexamples,archetypes,spotbugs,javadoc,sources,tck,tests,oci-sdk-cdi,pipeline
-Pexamples,archetypes,spotbugs,javadoc,sources,tck,tests,pipeline

#
# test running from jar file, and then from module path
Expand All @@ -49,4 +41,4 @@ tests/integration/native-image/mp-1/test-runtime.sh
tests/integration/native-image/mp-3/test-runtime.sh

# Build site and agregated javadocs
mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml -Poci-sdk-cdi site
mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml site
10 changes: 1 addition & 9 deletions etc/scripts/checkstyle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,17 @@
# Setup error handling using default settings (defined in includes/error_handlers.sh)
error_trap_setup

# Load OCI-related functions. WS_DIR is already defined, so there is
# no need to pass arguments.
. $(dirname -- "${SCRIPT_PATH}")/includes/oci.sh

readonly LOG_FILE=$(mktemp -t XXXcheckstyle-log)

readonly RESULT_FILE=$(mktemp -t XXXcheckstyle-result)

die() { echo "${1}" ; exit 1 ;}

# Install OCI shaded full jar, if necessary. This is an idempotent
# call.
install_oci_shaded_full_jar

mvn ${MAVEN_ARGS} checkstyle:checkstyle-aggregate \
-f ${WS_DIR}/pom.xml \
-Dcheckstyle.output.format="plain" \
-Dcheckstyle.output.file="${RESULT_FILE}" \
-Pexamples,oci-sdk-cdi,ossrh-releases > ${LOG_FILE} 2>&1 || (cat ${LOG_FILE} ; exit 1)
-Pexamples,ossrh-releases > ${LOG_FILE} 2>&1 || (cat ${LOG_FILE} ; exit 1)

grep "^\[ERROR\]" ${RESULT_FILE} \
&& die "CHECKSTYLE ERROR" || echo "CHECKSTYLE OK"
10 changes: 1 addition & 9 deletions etc/scripts/copyright.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,18 @@
# Setup error handling using default settings (defined in includes/error_handlers.sh)
error_trap_setup

# Load OCI-related functions. WS_DIR is already defined, so there is
# no need to pass arguments.
. $(dirname -- "${SCRIPT_PATH}")/includes/oci.sh

readonly LOG_FILE=$(mktemp -t XXXcopyright-log)

readonly RESULT_FILE=$(mktemp -t XXXcopyright-result)

die() { echo "${1}" ; exit 1 ;}

# Install OCI shaded full jar, if necessary. This is an idempotent
# call.
install_oci_shaded_full_jar

mvn ${MAVEN_ARGS} \
-f ${WS_DIR}/pom.xml \
-Dhelidon.enforcer.output.file="${RESULT_FILE}" \
-Dhelidon.enforcer.rules=copyright \
-Dhelidon.enforcer.failOnError=false \
-Pcopyright,oci-sdk-cdi \
-Pcopyright \
-N \
validate > ${LOG_FILE} 2>&1 || (cat ${LOG_FILE} ; exit 1)

Expand Down
172 changes: 0 additions & 172 deletions etc/scripts/includes/oci.sh

This file was deleted.

11 changes: 1 addition & 10 deletions etc/scripts/owasp-dependency-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,17 @@
# Setup error handling using default settings (defined in includes/error_handlers.sh)
error_trap_setup

# Load OCI-related functions. WS_DIR is already defined, so there is
# no need to pass arguments.
. $(dirname -- "${SCRIPT_PATH}")/includes/oci.sh

readonly RESULT_FILE=$(mktemp -t XXXdependency-check-result)

die() { cat ${RESULT_FILE} ; echo "Dependency report in ${WS_DIR}/target" ; echo "${1}" ; exit 1 ;}

# Install OCI shaded full jar, if necessary. This is an idempotent
# call.
install_oci_shaded_full_jar

if [ "${PIPELINE}" = "true" ] ; then
# If in pipeline do a priming build before scan
mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml -Poci-sdk-cdi clean install -DskipTests
mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml clean install -DskipTests
fi

mvn ${MAVEN_ARGS} -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN org.owasp:dependency-check-maven:aggregate \
-f ${WS_DIR}/pom.xml \
-Poci-sdk-cdi \
-Dtop.parent.basedir="${WS_DIR}" \
> ${RESULT_FILE} || die "Error running the Maven command"

Expand Down
13 changes: 2 additions & 11 deletions etc/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
# Setup error handling using default settings (defined in includes/error_handlers.sh)
error_trap_setup

# Load OCI-related functions. WS_DIR is already defined, so there is
# no need to pass arguments.
. $(dirname -- "${SCRIPT_PATH}")/includes/oci.sh

usage(){
cat <<EOF
Expand Down Expand Up @@ -86,10 +82,6 @@ if [ -z "${COMMAND}" ] ; then
exit 1
fi

# Install OCI shaded full jar, if necessary. This is an idempotent
# call.
install_oci_shaded_full_jar

# Hooks for version substitution work
readonly PREPARE_HOOKS=( )

Expand Down Expand Up @@ -121,7 +113,6 @@ printf "\n%s: FULL_VERSION=%s\n\n" "$(basename ${0})" "${FULL_VERSION}"
update_version(){
# Update version
mvn ${MAVEN_ARGS} -f ${WS_DIR}/parent/pom.xml versions:set versions:set-property \
-Poci-sdk-cdi \
-DgenerateBackupPoms=false \
-DnewVersion="${FULL_VERSION}" \
-Dproperty=helidon.version \
Expand Down Expand Up @@ -161,7 +152,7 @@ release_site(){
fi

# Generate site
mvn ${MAVEN_ARGS} -Poci-sdk-cdi site
mvn ${MAVEN_ARGS} site

# Sign site jar
gpg -ab ${WS_DIR}/target/helidon-project-${FULL_VERSION}-site.jar
Expand Down Expand Up @@ -219,7 +210,7 @@ release_build(){

# Perform deployment
mvn ${MAVEN_ARGS} clean deploy \
-Prelease,archetypes,oci-sdk-cdi \
-Prelease,archetypes \
-DskipTests \
-DstagingRepositoryId="${STAGING_REPO_ID}" \
-DretryFailedDeploymentCount="10"
Expand Down
10 changes: 1 addition & 9 deletions etc/scripts/test-integ-mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,16 @@
# Setup error handling using default settings (defined in includes/error_handlers.sh)
error_trap_setup

# Load OCI-related functions. WS_DIR is already defined, so there is
# no need to pass arguments.
. $(dirname -- "${SCRIPT_PATH}")/includes/oci.sh

# Set Graal VM into JAVA_HOME and PATH (defined in includes/pipeline-env.sh)
graalvm

mvn ${MAVEN_ARGS} --version

# Install OCI shaded full jar, if necessary. This is an idempotent
# call.
install_oci_shaded_full_jar

# Temporary workaround until job stages will share maven repository
mvn ${MAVEN_ARGS} -f ${WS_DIR}/pom.xml \
clean install -e \
-DskipTests \
-Ppipeline,oci-sdk-cdi
-Ppipeline

# Run tests in Java VM application
(cd tests/integration/jpa && \
Expand Down
Loading

0 comments on commit 75b1efe

Please sign in to comment.