From a5d67df2a111ebe57ec47bfa47e2ab6c1978f867 Mon Sep 17 00:00:00 2001 From: Arjav Desai Date: Tue, 11 Jul 2023 12:01:10 -0500 Subject: [PATCH] native image config for data modules --- .../src/main/archetype/mp/custom/database.xml | 4 +- .../src/main/archetype/se/custom/database.xml | 12 +-- bom/pom.xml | 12 ++- dbclient/jdbc/pom.xml | 4 +- .../native-image.properties | 6 +- dbclient/metrics-jdbc/pom.xml | 4 +- docs/se/dbclient.adoc | 4 +- examples/employee-app/pom.xml | 2 +- .../cdi/datasource-hikaricp-h2/pom.xml | 2 +- examples/integrations/cdi/jpa/pom.xml | 2 +- examples/integrations/cdi/pokemons/pom.xml | 2 +- .../integrations/micronaut/data/README.md | 4 +- examples/integrations/micronaut/data/pom.xml | 7 +- examples/integrations/oci/atp-cdi/pom.xml | 2 +- .../integrations/oci/atp-reactive/pom.xml | 2 +- integrations/cdi/datasource-hikaricp/pom.xml | 6 +- .../native-image/reflection-config.json | 12 --- .../native-image.properties | 6 +- .../reflect-config.json | 8 -- integrations/cdi/datasource-ucp/pom.xml | 11 ++- .../native-image/reflection-config.json | 7 ++ .../helidon/native-image/weld-proxies.json | 11 +++ integrations/cdi/eclipselink-cdi/pom.xml | 2 +- integrations/cdi/jpa-cdi/pom.xml | 2 +- integrations/db/hikaricp/pom.xml | 74 +++++++++++++++++++ .../native-image/reflection-config.json | 12 +++ .../hikaricp/native-image.properties | 18 +++++ .../hikaricp/reflect-config.json | 18 +++++ .../ojdbc/native-image.properties | 17 +++++ integrations/db/pom.xml | 2 + integrations/db/ucp/pom.xml | 71 ++++++++++++++++++ .../ucp/native-image.properties | 17 +++++ .../ucp/reflect-config.json | 10 +++ integrations/jdbc/jdbc/pom.xml | 2 +- integrations/jta/jdbc/pom.xml | 6 +- integrations/micronaut/data/pom.xml | 2 +- messaging/connectors/aq/pom.xml | 2 +- tests/integration/dbclient/appl/pom.xml | 4 +- tests/integration/dbclient/jdbc/pom.xml | 4 +- tests/integration/jpa/appl/pom.xml | 4 - tests/integration/jpa/simple/pom.xml | 2 +- tests/integration/native-image/mp-2/README.md | 7 +- tests/integration/native-image/mp-2/pom.xml | 2 +- 43 files changed, 324 insertions(+), 84 deletions(-) delete mode 100644 integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/helidon/native-image/reflection-config.json create mode 100644 integrations/cdi/datasource-ucp/src/main/resources/META-INF/helidon/native-image/reflection-config.json create mode 100644 integrations/cdi/datasource-ucp/src/main/resources/META-INF/helidon/native-image/weld-proxies.json create mode 100644 integrations/db/hikaricp/pom.xml create mode 100644 integrations/db/hikaricp/src/main/resources/META-INF/helidon/native-image/reflection-config.json create mode 100644 integrations/db/hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/hikaricp/native-image.properties create mode 100644 integrations/db/hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/hikaricp/reflect-config.json create mode 100644 integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/native-image.properties create mode 100644 integrations/db/ucp/pom.xml create mode 100644 integrations/db/ucp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ucp/native-image.properties create mode 100644 integrations/db/ucp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ucp/reflect-config.json diff --git a/archetypes/helidon/src/main/archetype/mp/custom/database.xml b/archetypes/helidon/src/main/archetype/mp/custom/database.xml index 68fbd3d298a..0c63dcc3a22 100644 --- a/archetypes/helidon/src/main/archetype/mp/custom/database.xml +++ b/archetypes/helidon/src/main/archetype/mp/custom/database.xml @@ -345,7 +345,7 @@ docker run --rm --name xe -p 1521:1521 -p 8888:8080 -e ORACLE_PWD=oracle wnamele runtime - com.oracle.database.jdbc + io.helidon.integrations.db ucp runtime @@ -431,7 +431,7 @@ docker run --rm --name xe -p 1521:1521 -p 8888:8080 -e ORACLE_PWD=oracle wnamele jakarta.xml.bind-api - com.h2database + io.helidon.integrations.db h2 diff --git a/archetypes/helidon/src/main/archetype/se/custom/database.xml b/archetypes/helidon/src/main/archetype/se/custom/database.xml index 0a8a72e113f..e234b567391 100644 --- a/archetypes/helidon/src/main/archetype/se/custom/database.xml +++ b/archetypes/helidon/src/main/archetype/se/custom/database.xml @@ -51,12 +51,12 @@ Instructions for H2 can be found here: https://www.h2database.com/html/cheatShee - com.h2database + io.helidon.integrations.db h2 - com.zaxxer - HikariCP + io.helidon.integrations.db + hikaricp id @@ -180,7 +180,7 @@ docker run --rm --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_D runtime - com.h2database + io.helidon.integrations.db h2 test @@ -222,7 +222,7 @@ docker run --rm --name xe -p 1521:1521 -p 8888:8080 -e ORACLE_PWD=oracle wnamele ojdbc - com.h2database + io.helidon.integrations.db h2 test @@ -263,7 +263,7 @@ docker run --rm --name mongo -p 27017:27017 mongo helidon-dbclient-mongodb - com.h2database + io.helidon.integrations.db h2 test diff --git a/bom/pom.xml b/bom/pom.xml index 8e9a25891fe..67f6ee289f3 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -802,6 +802,16 @@ + + io.helidon.integrations.db + h2 + ${helidon.version} + + + io.helidon.integrations.db + hikaricp + ${helidon.version} + io.helidon.integrations.db ojdbc @@ -809,7 +819,7 @@ io.helidon.integrations.db - h2 + ucp ${helidon.version} diff --git a/dbclient/jdbc/pom.xml b/dbclient/jdbc/pom.xml index 7668a336e94..340ff48ca31 100644 --- a/dbclient/jdbc/pom.xml +++ b/dbclient/jdbc/pom.xml @@ -47,8 +47,8 @@ helidon-common-configurable - com.zaxxer - HikariCP + io.helidon.integrations.db + hikaricp org.junit.jupiter diff --git a/dbclient/jdbc/src/main/resources/META-INF/native-image/io.helidon.dbclient/helidon-dbclient-jdbc/native-image.properties b/dbclient/jdbc/src/main/resources/META-INF/native-image/io.helidon.dbclient/helidon-dbclient-jdbc/native-image.properties index edd1cacc1f8..adb5e29ab3f 100644 --- a/dbclient/jdbc/src/main/resources/META-INF/native-image/io.helidon.dbclient/helidon-dbclient-jdbc/native-image.properties +++ b/dbclient/jdbc/src/main/resources/META-INF/native-image/io.helidon.dbclient/helidon-dbclient-jdbc/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2022 Oracle and/or its affiliates. +# Copyright (c) 2019, 2023 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,6 +14,4 @@ # limitations under the License. # -Args= --initialize-at-build-time=org.slf4j \ - --initialize-at-build-time=com.zaxxer.hikari \ - --initialize-at-run-time=com.zaxxer.hikari.metrics.dropwizard.CodaHaleMetricsTracker +Args= --initialize-at-build-time=org.slf4j diff --git a/dbclient/metrics-jdbc/pom.xml b/dbclient/metrics-jdbc/pom.xml index 9564a97908e..b749c3834cd 100644 --- a/dbclient/metrics-jdbc/pom.xml +++ b/dbclient/metrics-jdbc/pom.xml @@ -44,8 +44,8 @@ helidon-metrics - com.zaxxer - HikariCP + io.helidon.integrations.db + hikaricp io.dropwizard.metrics diff --git a/docs/se/dbclient.adoc b/docs/se/dbclient.adoc index fa89864afa1..c8d1bcc64d2 100644 --- a/docs/se/dbclient.adoc +++ b/docs/se/dbclient.adoc @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// - Copyright (c) 2020, 2022 Oracle and/or its affiliates. + Copyright (c) 2020, 2023 Oracle and/or its affiliates. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -119,7 +119,7 @@ For the DB Client using JDBC implementation and H2 database, you must include th helidon-dbclient-jdbc - com.h2database + io.helidon.integrations.db h2 diff --git a/examples/employee-app/pom.xml b/examples/employee-app/pom.xml index 1cf189ae408..edf8b89462a 100644 --- a/examples/employee-app/pom.xml +++ b/examples/employee-app/pom.xml @@ -42,7 +42,7 @@ ojdbc - com.oracle.database.jdbc + io.helidon.integrations.db ucp diff --git a/examples/integrations/cdi/datasource-hikaricp-h2/pom.xml b/examples/integrations/cdi/datasource-hikaricp-h2/pom.xml index d6a4194e4a7..03bbf2f9b0c 100644 --- a/examples/integrations/cdi/datasource-hikaricp-h2/pom.xml +++ b/examples/integrations/cdi/datasource-hikaricp-h2/pom.xml @@ -51,7 +51,7 @@ - com.h2database + io.helidon.integrations.db h2 runtime diff --git a/examples/integrations/cdi/jpa/pom.xml b/examples/integrations/cdi/jpa/pom.xml index eb7a1365d64..1d11f019dcb 100644 --- a/examples/integrations/cdi/jpa/pom.xml +++ b/examples/integrations/cdi/jpa/pom.xml @@ -67,7 +67,7 @@ - com.h2database + io.helidon.integrations.db h2 runtime diff --git a/examples/integrations/cdi/pokemons/pom.xml b/examples/integrations/cdi/pokemons/pom.xml index a4dd9c0e5c2..519ad033b3a 100644 --- a/examples/integrations/cdi/pokemons/pom.xml +++ b/examples/integrations/cdi/pokemons/pom.xml @@ -65,7 +65,7 @@ - com.h2database + io.helidon.integrations.db h2 runtime diff --git a/examples/integrations/micronaut/data/README.md b/examples/integrations/micronaut/data/README.md index afd82933c78..49bf8a4a2ce 100644 --- a/examples/integrations/micronaut/data/README.md +++ b/examples/integrations/micronaut/data/README.md @@ -67,7 +67,7 @@ curl -i http://localhost:8080/pets/s runtime - com.oracle.database.jdbc + io.helidon.integrations.db ucp runtime @@ -112,7 +112,7 @@ curl -i http://localhost:8080/pets/s runtime - com.oracle.database.jdbc + io.helidon.integrations.db ucp runtime diff --git a/examples/integrations/micronaut/data/pom.xml b/examples/integrations/micronaut/data/pom.xml index 75c49c968d4..fa91ef15f9c 100644 --- a/examples/integrations/micronaut/data/pom.xml +++ b/examples/integrations/micronaut/data/pom.xml @@ -69,12 +69,7 @@ runtime - com.h2database - - + io.helidon.integrations.db h2 runtime diff --git a/examples/integrations/oci/atp-cdi/pom.xml b/examples/integrations/oci/atp-cdi/pom.xml index fc015fd5946..982857beb00 100644 --- a/examples/integrations/oci/atp-cdi/pom.xml +++ b/examples/integrations/oci/atp-cdi/pom.xml @@ -47,7 +47,7 @@ ojdbc - com.oracle.database.jdbc + io.helidon.integrations.db ucp diff --git a/examples/integrations/oci/atp-reactive/pom.xml b/examples/integrations/oci/atp-reactive/pom.xml index a2a34a0fa98..eb64451a1de 100644 --- a/examples/integrations/oci/atp-reactive/pom.xml +++ b/examples/integrations/oci/atp-reactive/pom.xml @@ -55,7 +55,7 @@ ojdbc - com.oracle.database.jdbc + io.helidon.integrations.db ucp diff --git a/integrations/cdi/datasource-hikaricp/pom.xml b/integrations/cdi/datasource-hikaricp/pom.xml index f84f0c074ea..d39f06ac5ab 100644 --- a/integrations/cdi/datasource-hikaricp/pom.xml +++ b/integrations/cdi/datasource-hikaricp/pom.xml @@ -42,8 +42,8 @@ compile - com.zaxxer - HikariCP + io.helidon.integrations.db + hikaricp compile @@ -90,7 +90,7 @@ - com.h2database + io.helidon.integrations.db h2 test diff --git a/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/helidon/native-image/reflection-config.json b/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/helidon/native-image/reflection-config.json deleted file mode 100644 index 30b2e6bfb9f..00000000000 --- a/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/helidon/native-image/reflection-config.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "annotated": [], - "class-hierarchy": [ - "com.zaxxer.hikari.HikariConfig", - "com.zaxxer.hikari.pool.PoolBase", - "com.zaxxer.hikari.HikariConfigMXBean" - ], - "classes": [ - "com.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry[]" - ], - "exclude": [] -} diff --git a/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/native-image.properties b/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/native-image.properties index 5901aa4594b..1eb83493ffe 100644 --- a/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/native-image.properties +++ b/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/native-image.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, 2022 Oracle and/or its affiliates. +# Copyright (c) 2020, 2023 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,6 +14,4 @@ # limitations under the License. # -Args=--initialize-at-build-time=com.zaxxer.hikari \ - --initialize-at-build-time=org.slf4j \ - --initialize-at-run-time=com.zaxxer.hikari.metrics.dropwizard.CodaHaleMetricsTracker +Args=--initialize-at-build-time=org.slf4j diff --git a/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/reflect-config.json b/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/reflect-config.json index 4ac729c2705..07c4e5fcefb 100644 --- a/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/reflect-config.json +++ b/integrations/cdi/datasource-hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.cdi/helidon-integrations-cdi-datasource-hikaricp/reflect-config.json @@ -1,12 +1,4 @@ [ - { - "name": "com.zaxxer.hikari.HikariConfig", - "allDeclaredConstructors": true, - "allDeclaredMethods": true, - "allPublicMethods": true, - "allDeclaredFields": true, - "allPublicFields": true - }, { "name": "java.util.concurrent.CopyOnWriteArrayList", "fields": [ diff --git a/integrations/cdi/datasource-ucp/pom.xml b/integrations/cdi/datasource-ucp/pom.xml index 0c92db25af2..8c30ec6d672 100644 --- a/integrations/cdi/datasource-ucp/pom.xml +++ b/integrations/cdi/datasource-ucp/pom.xml @@ -36,7 +36,7 @@ - ${project.groupId} + io.helidon.integrations.cdi helidon-integrations-cdi-datasource compile @@ -46,7 +46,7 @@ compile - com.oracle.database.jdbc + io.helidon.integrations.db ucp compile @@ -99,10 +99,15 @@ test - com.h2database + io.helidon.integrations.db h2 test + + io.helidon.integrations.db + ojdbc + test + io.helidon.microprofile.server helidon-microprofile-server diff --git a/integrations/cdi/datasource-ucp/src/main/resources/META-INF/helidon/native-image/reflection-config.json b/integrations/cdi/datasource-ucp/src/main/resources/META-INF/helidon/native-image/reflection-config.json new file mode 100644 index 00000000000..62eb889485e --- /dev/null +++ b/integrations/cdi/datasource-ucp/src/main/resources/META-INF/helidon/native-image/reflection-config.json @@ -0,0 +1,7 @@ +{ + "classes": [ + "oracle.ucp.jdbc.PoolDataSource", + "oracle.ucp.jdbc.PoolDataSourceImpl", + "javax.sql.DataSource" + ] +} \ No newline at end of file diff --git a/integrations/cdi/datasource-ucp/src/main/resources/META-INF/helidon/native-image/weld-proxies.json b/integrations/cdi/datasource-ucp/src/main/resources/META-INF/helidon/native-image/weld-proxies.json new file mode 100644 index 00000000000..33c00c25511 --- /dev/null +++ b/integrations/cdi/datasource-ucp/src/main/resources/META-INF/helidon/native-image/weld-proxies.json @@ -0,0 +1,11 @@ +[ + { + "bean-class": "io.helidon.integrations.datasource.ucp.cdi.UCPBackedDataSourceExtension", + "ifaces": [ + "io.helidon.integrations.datasource.ucp.cdi.UCPBackedDataSourceExtension", + "oracle.ucp.jdbc.PoolDataSource", + "oracle.ucp.jdbc.PoolDataSourceImpl", + "javax.sql.DataSource" + ] + } +] \ No newline at end of file diff --git a/integrations/cdi/eclipselink-cdi/pom.xml b/integrations/cdi/eclipselink-cdi/pom.xml index 266ff465a8b..e0dc49bf741 100644 --- a/integrations/cdi/eclipselink-cdi/pom.xml +++ b/integrations/cdi/eclipselink-cdi/pom.xml @@ -57,7 +57,7 @@ test - com.h2database + io.helidon.integrations.db h2 test diff --git a/integrations/cdi/jpa-cdi/pom.xml b/integrations/cdi/jpa-cdi/pom.xml index fda786edc7d..f1fe9f51ed4 100644 --- a/integrations/cdi/jpa-cdi/pom.xml +++ b/integrations/cdi/jpa-cdi/pom.xml @@ -147,7 +147,7 @@ - com.h2database + io.helidon.integrations.db h2 test diff --git a/integrations/db/hikaricp/pom.xml b/integrations/db/hikaricp/pom.xml new file mode 100644 index 00000000000..0da803e8c72 --- /dev/null +++ b/integrations/db/hikaricp/pom.xml @@ -0,0 +1,74 @@ + + + + + 4.0.0 + + io.helidon.integrations.db + helidon-integrations-db-project + 3.2.2-SNAPSHOT + + + hikaricp + Helidon Integrations DB HikariCP + HikariCP for databases with native-image support + + + + true + true + + + + + com.zaxxer + HikariCP + + + + + + release + + + + org.apache.maven.plugins + maven-jar-plugin + + + empty-javadoc-jar + package + + jar + + + javadoc + ${project.build.directory}/javadoc + + + + + + + + + \ No newline at end of file diff --git a/integrations/db/hikaricp/src/main/resources/META-INF/helidon/native-image/reflection-config.json b/integrations/db/hikaricp/src/main/resources/META-INF/helidon/native-image/reflection-config.json new file mode 100644 index 00000000000..c390237aca6 --- /dev/null +++ b/integrations/db/hikaricp/src/main/resources/META-INF/helidon/native-image/reflection-config.json @@ -0,0 +1,12 @@ +{ + "annotated": [], + "class-hierarchy": [ + "com.zaxxer.hikari.HikariConfig", + "com.zaxxer.hikari.pool.PoolBase", + "com.zaxxer.hikari.HikariConfigMXBean" + ], + "classes": [ + "com.zaxxer.hikari.util.ConcurrentBag$IConcurrentBagEntry[]" + ], + "exclude": [] +} \ No newline at end of file diff --git a/integrations/db/hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/hikaricp/native-image.properties b/integrations/db/hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/hikaricp/native-image.properties new file mode 100644 index 00000000000..90d9064651b --- /dev/null +++ b/integrations/db/hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/hikaricp/native-image.properties @@ -0,0 +1,18 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +Args=--initialize-at-build-time=com.zaxxer.hikari \ + --initialize-at-run-time=com.zaxxer.hikari.metrics.dropwizard.CodaHaleMetricsTracker diff --git a/integrations/db/hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/hikaricp/reflect-config.json b/integrations/db/hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/hikaricp/reflect-config.json new file mode 100644 index 00000000000..79da23b8cd7 --- /dev/null +++ b/integrations/db/hikaricp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/hikaricp/reflect-config.json @@ -0,0 +1,18 @@ +[ + { + "name": "com.zaxxer.hikari.HikariConfig", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredFields": true, + "allPublicFields": true + }, + { + "name": "java.sql.Statement[]", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredFields": true, + "allPublicFields": true + } +] \ No newline at end of file diff --git a/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/native-image.properties b/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/native-image.properties new file mode 100644 index 00000000000..0bc86af85b2 --- /dev/null +++ b/integrations/db/ojdbc/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ojdbc/native-image.properties @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +Args=--initialize-at-run-time=oracle.jdbc.driver.NTFListener diff --git a/integrations/db/pom.xml b/integrations/db/pom.xml index f1d22d7d1a2..76dc20d5714 100644 --- a/integrations/db/pom.xml +++ b/integrations/db/pom.xml @@ -38,8 +38,10 @@ h2 + hikaricp mysql ojdbc pgsql + ucp diff --git a/integrations/db/ucp/pom.xml b/integrations/db/ucp/pom.xml new file mode 100644 index 00000000000..db3c33e3330 --- /dev/null +++ b/integrations/db/ucp/pom.xml @@ -0,0 +1,71 @@ + + + + + 4.0.0 + + io.helidon.integrations.db + helidon-integrations-db-project + 3.2.2-SNAPSHOT + + + ucp + Helidon Integrations DB Oracle UCP + UCP for Oracle database with native-image support + + + true + true + + + + + com.oracle.database.jdbc + ucp + jar + + + + + + release + + + + org.apache.maven.plugins + maven-jar-plugin + + + empty-javadoc-jar + package + + jar + + + javadoc + ${project.build.directory}/javadoc + + + + + + + + + \ No newline at end of file diff --git a/integrations/db/ucp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ucp/native-image.properties b/integrations/db/ucp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ucp/native-image.properties new file mode 100644 index 00000000000..edcb1912a30 --- /dev/null +++ b/integrations/db/ucp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ucp/native-image.properties @@ -0,0 +1,17 @@ +# +# Copyright (c) 2023 Oracle and/or its affiliates. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +Args=--initialize-at-run-time=oracle.ucp.common.Service diff --git a/integrations/db/ucp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ucp/reflect-config.json b/integrations/db/ucp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ucp/reflect-config.json new file mode 100644 index 00000000000..d5ad3a46075 --- /dev/null +++ b/integrations/db/ucp/src/main/resources/META-INF/native-image/io.helidon.integrations.db/ucp/reflect-config.json @@ -0,0 +1,10 @@ +[ + { + "name": "oracle.ucp.jdbc.PoolDataSourceImpl", + "allDeclaredConstructors": true, + "allDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredFields": true, + "allPublicFields": true + } +] \ No newline at end of file diff --git a/integrations/jdbc/jdbc/pom.xml b/integrations/jdbc/jdbc/pom.xml index 7c94cf53a91..ba944fd4a3f 100644 --- a/integrations/jdbc/jdbc/pom.xml +++ b/integrations/jdbc/jdbc/pom.xml @@ -52,7 +52,7 @@ - com.h2database + io.helidon.integrations.db h2 test diff --git a/integrations/jta/jdbc/pom.xml b/integrations/jta/jdbc/pom.xml index 58efb055bc4..dadd7293b63 100644 --- a/integrations/jta/jdbc/pom.xml +++ b/integrations/jta/jdbc/pom.xml @@ -64,14 +64,14 @@ - com.h2database + io.helidon.integrations.db h2 test - com.zaxxer - HikariCP + io.helidon.integrations.db + hikaricp test diff --git a/integrations/micronaut/data/pom.xml b/integrations/micronaut/data/pom.xml index 157ceefa731..407864c0a8f 100644 --- a/integrations/micronaut/data/pom.xml +++ b/integrations/micronaut/data/pom.xml @@ -100,7 +100,7 @@ test - com.h2database + io.helidon.integrations.db h2 test diff --git a/messaging/connectors/aq/pom.xml b/messaging/connectors/aq/pom.xml index 122dd2c1624..0073c1027b8 100644 --- a/messaging/connectors/aq/pom.xml +++ b/messaging/connectors/aq/pom.xml @@ -62,7 +62,7 @@ ojdbc - com.oracle.database.jdbc + io.helidon.integrations.db ucp diff --git a/tests/integration/dbclient/appl/pom.xml b/tests/integration/dbclient/appl/pom.xml index baa0d63dfe7..42632669e0d 100644 --- a/tests/integration/dbclient/appl/pom.xml +++ b/tests/integration/dbclient/appl/pom.xml @@ -98,8 +98,8 @@ parsson - com.zaxxer - HikariCP + io.helidon.integrations.db + hikaricp org.slf4j diff --git a/tests/integration/dbclient/jdbc/pom.xml b/tests/integration/dbclient/jdbc/pom.xml index 90d4cd2eac1..6a10475debb 100644 --- a/tests/integration/dbclient/jdbc/pom.xml +++ b/tests/integration/dbclient/jdbc/pom.xml @@ -57,8 +57,8 @@ test - com.zaxxer - HikariCP + io.helidon.integrations.db + hikaricp test diff --git a/tests/integration/jpa/appl/pom.xml b/tests/integration/jpa/appl/pom.xml index 1d7c14c81a3..abc3b03c241 100644 --- a/tests/integration/jpa/appl/pom.xml +++ b/tests/integration/jpa/appl/pom.xml @@ -371,10 +371,6 @@ io.helidon.integrations.db h2 - - - com.h2database - h2 runtime diff --git a/tests/integration/jpa/simple/pom.xml b/tests/integration/jpa/simple/pom.xml index 8358f41c65e..79cd04102dc 100644 --- a/tests/integration/jpa/simple/pom.xml +++ b/tests/integration/jpa/simple/pom.xml @@ -98,7 +98,7 @@ - com.h2database + io.helidon.integrations.db h2 test diff --git a/tests/integration/native-image/mp-2/README.md b/tests/integration/native-image/mp-2/README.md index 787287661e4..88fdfe7c49a 100644 --- a/tests/integration/native-image/mp-2/README.md +++ b/tests/integration/native-image/mp-2/README.md @@ -34,6 +34,7 @@ INSERT INTO GREETING (FIRSTPART, SECONDPART) VALUES ('Jack', 'The Ripper') ``` -1. Comment out `ojdbc` and uncomment `h2` in `pom.xml` -2. Comment out `org.hibernate.dialect.Oracle10gDialect"` and uncomment `org.hibernate.dialect.H2Dialect` in `persistence.xml` -3. Comment out all oracle driver properties and uncomment all h2 driver properties in `microprofile-config.properties` +1. Change `ojdbc` to `h2` for `io.helidon.integrations.db` in `pom.xml` +2. Change `helidon-integrations-cdi-datasource-ucp` to `helidon-integrations-cdi-datasource-hiakricp` for `io.helidon.integrations.cdi` in `pom.xml` +3. Comment out `org.hibernate.dialect.Oracle10gDialect"` and uncomment `org.hibernate.dialect.H2Dialect` in `persistence.xml` +4. Comment out all oracle driver properties and uncomment all h2 driver properties in `microprofile-config.properties` \ No newline at end of file diff --git a/tests/integration/native-image/mp-2/pom.xml b/tests/integration/native-image/mp-2/pom.xml index 3ab4313f534..67e57aa4722 100644 --- a/tests/integration/native-image/mp-2/pom.xml +++ b/tests/integration/native-image/mp-2/pom.xml @@ -88,7 +88,7 @@ io.helidon.integrations.cdi - helidon-integrations-cdi-datasource-hikaricp + helidon-integrations-cdi-datasource-ucp runtime