From df342fed72ba9e272bcb9c4a93a395dfa921a6c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?JB=20Onofr=C3=A9?= Date: Sun, 20 Apr 2025 22:47:06 +0200 Subject: [PATCH] Ship eclipselink and PostgreSQL JDBC driver by default in Polaris distribution --- .github/workflows/helm.yml | 3 +-- .../assets/cloud_providers/deploy-aws.sh | 1 - .../assets/cloud_providers/deploy-azure.sh | 1 - .../assets/cloud_providers/deploy-gcp.sh | 1 - getting-started/eclipselink/README.md | 1 - helm/polaris/README.md | 7 +++--- helm/polaris/README.md.gotmpl | 5 ++-- quarkus/admin/distribution/LICENSE | 17 ++++++++----- quarkus/server/build.gradle.kts | 5 ++-- quarkus/server/distribution/LICENSE | 18 ++++++++++++++ run.sh | 2 +- site/content/in-dev/unreleased/admin-tool.md | 3 +-- .../unreleased/getting-started/quickstart.md | 1 - site/content/in-dev/unreleased/metastores.md | 24 +++++-------------- 14 files changed, 45 insertions(+), 44 deletions(-) diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index b8458e80fc..f56cc34477 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -104,8 +104,7 @@ jobs: :polaris-quarkus-server:quarkusAppPartsBuild --rerun \ :polaris-quarkus-admin:assemble \ :polaris-quarkus-admin:quarkusAppPartsBuild --rerun \ - -Dquarkus.container-image.build=true \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 + -Dquarkus.container-image.build=true minikube image ls - name: Install fixtures diff --git a/getting-started/assets/cloud_providers/deploy-aws.sh b/getting-started/assets/cloud_providers/deploy-aws.sh index c943eb69b8..140b8068fb 100644 --- a/getting-started/assets/cloud_providers/deploy-aws.sh +++ b/getting-started/assets/cloud_providers/deploy-aws.sh @@ -70,7 +70,6 @@ FULL_POSTGRES_ADDR=$(printf '%s\n' "jdbc:postgresql://$POSTGRES_ADDR/{realm}" | sed -i "/jakarta.persistence.jdbc.url/ s|value=\"[^\"]*\"|value=\"$FULL_POSTGRES_ADDR\"|" "getting-started/assets/eclipselink/persistence.xml" ./gradlew clean :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ -Dquarkus.container-image.tag=postgres-latest \ -Dquarkus.container-image.build=true \ --no-build-cache diff --git a/getting-started/assets/cloud_providers/deploy-azure.sh b/getting-started/assets/cloud_providers/deploy-azure.sh index 76ee85432b..f157119edb 100644 --- a/getting-started/assets/cloud_providers/deploy-azure.sh +++ b/getting-started/assets/cloud_providers/deploy-azure.sh @@ -32,7 +32,6 @@ FULL_POSTGRES_ADDR=$(printf '%s\n' "jdbc:postgresql://$POSTGRES_ADDR:5432/{realm sed -i "/jakarta.persistence.jdbc.url/ s|value=\"[^\"]*\"|value=\"$FULL_POSTGRES_ADDR\"|" "getting-started/assets/eclipselink/persistence.xml" ./gradlew clean :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ -Dquarkus.container-image.tag=postgres-latest \ -Dquarkus.container-image.build=true \ --no-build-cache diff --git a/getting-started/assets/cloud_providers/deploy-gcp.sh b/getting-started/assets/cloud_providers/deploy-gcp.sh index 5da93b5585..76797fbec5 100644 --- a/getting-started/assets/cloud_providers/deploy-gcp.sh +++ b/getting-started/assets/cloud_providers/deploy-gcp.sh @@ -42,7 +42,6 @@ FULL_POSTGRES_ADDR=$(printf '%s\n' "jdbc:postgresql://$POSTGRES_ADDR:5432/{realm sed -i "/jakarta.persistence.jdbc.url/ s|value=\"[^\"]*\"|value=\"$FULL_POSTGRES_ADDR\"|" "getting-started/assets/eclipselink/persistence.xml" ./gradlew clean :polaris-quarkus-server:assemble :polaris-quarkus-admin:assemble \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ -Dquarkus.container-image.tag=postgres-latest \ -Dquarkus.container-image.build=true \ --no-build-cache diff --git a/getting-started/eclipselink/README.md b/getting-started/eclipselink/README.md index 765ccf379d..29c75adc9e 100644 --- a/getting-started/eclipselink/README.md +++ b/getting-started/eclipselink/README.md @@ -30,7 +30,6 @@ This example requires `jq` to be installed on your machine. :polaris-quarkus-server:quarkusAppPartsBuild --rerun \ :polaris-quarkus-admin:assemble \ :polaris-quarkus-admin:quarkusAppPartsBuild --rerun \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ -Dquarkus.container-image.tag=postgres-latest \ -Dquarkus.container-image.build=true ``` diff --git a/helm/polaris/README.md b/helm/polaris/README.md index e82ec79af8..886cd4ed3f 100644 --- a/helm/polaris/README.md +++ b/helm/polaris/README.md @@ -70,7 +70,7 @@ Simply run the `run.sh` script from the Polaris repo root, making sure to specif `--eclipse-link-deps` option: ```bash -./run.sh --eclipse-link-deps=org.postgresql:postgresql:42.7.4 +./run.sh ``` This script will create a Kind cluster, deploy a local Docker registry, build the Polaris Docker @@ -86,13 +86,12 @@ If necessary, build and load the Docker images with support for Postgres into Mi ```bash eval $(minikube -p minikube docker-env) -./gradlew \ +./gradlew \ :polaris-quarkus-server:assemble \ :polaris-quarkus-server:quarkusAppPartsBuild --rerun \ :polaris-quarkus-admin:assemble \ :polaris-quarkus-admin:quarkusAppPartsBuild --rerun \ - -Dquarkus.container-image.build=true \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 + -Dquarkus.container-image.build=true ``` ### Installing the chart locally diff --git a/helm/polaris/README.md.gotmpl b/helm/polaris/README.md.gotmpl index 18291a1e3e..d478c6518f 100644 --- a/helm/polaris/README.md.gotmpl +++ b/helm/polaris/README.md.gotmpl @@ -71,7 +71,7 @@ Simply run the `run.sh` script from the Polaris repo root, making sure to specif `--eclipse-link-deps` option: ```bash -./run.sh --eclipse-link-deps=org.postgresql:postgresql:42.7.4 +./run.sh ``` This script will create a Kind cluster, deploy a local Docker registry, build the Polaris Docker @@ -92,8 +92,7 @@ eval $(minikube -p minikube docker-env) :polaris-quarkus-server:quarkusAppPartsBuild --rerun \ :polaris-quarkus-admin:assemble \ :polaris-quarkus-admin:quarkusAppPartsBuild --rerun \ - -Dquarkus.container-image.build=true \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 + -Dquarkus.container-image.build=true ``` ### Installing the chart locally diff --git a/quarkus/admin/distribution/LICENSE b/quarkus/admin/distribution/LICENSE index 045da7ede5..f97ff25ea0 100644 --- a/quarkus/admin/distribution/LICENSE +++ b/quarkus/admin/distribution/LICENSE @@ -1405,8 +1405,8 @@ License (from POM): Apache License 2.0 - https://www.apache.org/licenses/LICENSE -------------------------------------------------------------------------------- Group: org.eclipse.angus Name: angus-activation Version: 2.0.2 -Project URL (from POM): https://github.com/eclipse-ee4j/angus-activation -License (from POM): EDL 1.0 - http://www.eclipse.org/org/documents/edl-v10.php +Project URL: https://github.com/eclipse-ee4j/angus-activation +License: Eclipse Public License 2.0 - https://projects.eclipse.org/license/epl-2.0 -------------------------------------------------------------------------------- @@ -1428,10 +1428,9 @@ License: Eclipse Public License 2.0 - https://projects.eclipse.org/license/epl-2 -------------------------------------------------------------------------------- -org.eclipse.persistence.eclipselink-4.0.5.jar -Project URL (from POM): http://www.eclipse.org/eclipselink -License (from POM): Eclipse Public License 2.0 - http://www.eclipse.org/legal/epl-2.0 -License (from POM): Eclipse Distribution License 1.0 - http://www.eclipse.org/org/documents/edl-v10.php +Group: org.eclipse.persistence Name: eclipselink Version: 4.0.6 +Project URL: https://eclipse.dev/eclipselink/ +License: Eclipse Public License 2.0 - https://projects.eclipse.org/license/epl-2.0 -------------------------------------------------------------------------------- @@ -1723,3 +1722,9 @@ Project URL (from POM): https://github.com/awslabs/aws-eventstream-java License (from POM): Apache License 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt -------------------------------------------------------------------------------- + +Group: org.postgresql Name: postgresql Version: 42.7.5 +Project URL: https://jdbc.postgresql.org/ +License (from POM): BSD-2-Clause - https://opensource.org/licenses/BSD-2-Clause + +-------------------------------------------------------------------------------- diff --git a/quarkus/server/build.gradle.kts b/quarkus/server/build.gradle.kts index 92aefa2a5c..61c1b46660 100644 --- a/quarkus/server/build.gradle.kts +++ b/quarkus/server/build.gradle.kts @@ -48,9 +48,8 @@ dependencies { implementation(project(":polaris-service-common")) implementation(project(":polaris-quarkus-service")) - if (project.hasProperty("eclipseLinkDeps")) { - runtimeOnly(project(":polaris-eclipselink")) - } + runtimeOnly(project(":polaris-eclipselink")) + runtimeOnly("org.postgresql:postgresql") // enforce the Quarkus _platform_ here, to get a consistent and validated set of dependencies implementation(enforcedPlatform(libs.quarkus.bom)) diff --git a/quarkus/server/distribution/LICENSE b/quarkus/server/distribution/LICENSE index 71d52f3c64..c8ce2c86bc 100644 --- a/quarkus/server/distribution/LICENSE +++ b/quarkus/server/distribution/LICENSE @@ -2086,6 +2086,12 @@ License (from POM): Apache License 2.0 - https://www.apache.org/licenses/LICENSE -------------------------------------------------------------------------------- +Group: org.eclipse.angus Name: angus-activation Version: 2.0.2 +Project URL: https://projects.eclipse.org/projects/ee4j.angus +License: Eclipse Public License 2.0 - https://projects.eclipse.org/license/epl-2.0 + +-------------------------------------------------------------------------------- + Group: org.eclipse.jetty Name: jetty-http Version: 9.4.53.v20231009 Project URL (from POM): https://eclipse.org/jetty License (from POM): Apache License 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt @@ -2167,6 +2173,12 @@ License (from POM): Apache License 2.0 - https://www.apache.org/licenses/LICENSE -------------------------------------------------------------------------------- +Group: org.eclipse.persistence Name: eclipselink Version: 4.0.6 +Project URL: https://eclipse.dev/eclipselink/ +License: Eclipse Public License 2.0 - https://projects.eclipse.org/license/epl-2.0 + +-------------------------------------------------------------------------------- + Group: org.glassfish.expressly Name: expressly Version: 5.0.0 Project URL (from POM): https://projects.eclipse.org/projects/ee4j License (from POM): EPL 2.0 - https://www.eclipse.org/legal/epl-2.0 @@ -2480,3 +2492,9 @@ Project URL (from POM): https://github.com/awslabs/aws-eventstream-java License (from POM): Apache License 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt -------------------------------------------------------------------------------- + +Group: org.postgresql Name: postgresql Version: 42.7.5 +Project URL: https://jdbc.postgresql.org/ +License (from POM): BSD-2-Clause - https://opensource.org/licenses/BSD-2-Clause + +-------------------------------------------------------------------------------- diff --git a/run.sh b/run.sh index 1394e6e66f..11b427f1d1 100755 --- a/run.sh +++ b/run.sh @@ -25,7 +25,7 @@ usage() { echo "Usage: $0 [--eclipse-link-deps=] [-h|--help]" echo " --eclipse-link-deps= EclipseLink dependencies to use, e.g." - echo " --eclipse-link-deps=org.postgresql:postgresql:42.7.4" + echo " --eclipse-link-deps=com.h2database:h2:2.3.232" echo " -h, --help Display this help message" exit 1 } diff --git a/site/content/in-dev/unreleased/admin-tool.md b/site/content/in-dev/unreleased/admin-tool.md index 77409dd62c..1e5a76b072 100644 --- a/site/content/in-dev/unreleased/admin-tool.md +++ b/site/content/in-dev/unreleased/admin-tool.md @@ -31,8 +31,7 @@ example, to build the tool with support for Postgres, run the following: ./gradlew \ :polaris-quarkus-admin:assemble \ :polaris-quarkus-admin:quarkusAppPartsBuild --rerun \ - -Dquarkus.container-image.build=true \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 + -Dquarkus.container-image.build=true ``` The above command will generate: diff --git a/site/content/in-dev/unreleased/getting-started/quickstart.md b/site/content/in-dev/unreleased/getting-started/quickstart.md index 660ed5ae10..a1a5d32df2 100644 --- a/site/content/in-dev/unreleased/getting-started/quickstart.md +++ b/site/content/in-dev/unreleased/getting-started/quickstart.md @@ -34,7 +34,6 @@ cd ~/polaris :polaris-quarkus-server:assemble \ :polaris-quarkus-server:quarkusAppPartsBuild \ :polaris-quarkus-admin:assemble --rerun \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 \ -Dquarkus.container-image.tag=postgres-latest \ -Dquarkus.container-image.build=true docker compose -f getting-started/eclipselink/docker-compose.yml up diff --git a/site/content/in-dev/unreleased/metastores.md b/site/content/in-dev/unreleased/metastores.md index 46a33c6276..acafb602b1 100644 --- a/site/content/in-dev/unreleased/metastores.md +++ b/site/content/in-dev/unreleased/metastores.md @@ -24,12 +24,11 @@ weight: 700 This page documents important configurations for connecting to a production database through [EclipseLink](https://eclipse.dev/eclipselink/). -## Building Polaris with EclipseLink +## Polaris EclipseLink -Polaris doesn't ship with any JDBC driver. You must specify them when building Polaris with -EclipseLink by using Gradle's project property: -`-PeclipseLinkDeps=,,...`. See below examples for H2 -and Postgres. +Polaris includes EclipseLink plugin by default with PostgreSQL driver. + +In order to add other JDBC drivers, you have to build Polaris using the `eclipseLinkDeps` build property. ## Polaris Server Configuration @@ -104,6 +103,8 @@ java -Dpolaris.persistence.type=eclipse-link \ ### Using Postgres +PostgreSQL is included by default in the Polaris server distribution. + The following shows a sample configuration for integrating Polaris with Postgres. ```xml @@ -129,16 +130,3 @@ The following shows a sample configuration for integrating Polaris with Postgres ``` - -To build Polaris with the necessary Postgres dependency and start the Polaris service, run the following: - -```shell -./gradlew \ - :polaris-quarkus-server:assemble \ - :polaris-quarkus-server:quarkusAppPartsBuild --rerun \ - -PeclipseLinkDeps=org.postgresql:postgresql:42.7.4 -java -Dpolaris.persistence.type=eclipse-link \ - -Dpolaris.persistence.eclipselink.configuration-file=/path/to/persistence.xml \ - -Dpolaris.persistence.eclipselink.persistence-unit=polaris \ - -jar quarkus/server/build/quarkus-app/quarkus-run.jar -```