Update native image for JPA.

* use Helidon h2 driver
* move native configuration to correct modules

Signed-off-by: Tomas Langer <tomas.langer@oracle.com>
This commit is contained in:
Tomas Langer
2020-06-19 13:39:26 +02:00
committed by Tomas Langer
parent 8233ebb3d4
commit 1c6cf71ab1
7 changed files with 13 additions and 93 deletions

View File

@@ -31,10 +31,6 @@
<description>Parent pom for Helidon MP applications</description>
<properties>
<!-- we need this explicit version to work with native image -->
<version.h2.jdbc>1.2.1.Final</version.h2.jdbc>
<!-- we need this explicit version to work with native image -->
<version.h2.db>1.4.197</version.h2.db>
<version.plugin.jandex>1.0.6</version.plugin.jandex>
<version.plugin.jaxb2>0.14.0</version.plugin.jaxb2>
<version.plugin.eclipselink>2.7.1.1</version.plugin.eclipselink>
@@ -42,21 +38,6 @@
<mainClass>io.helidon.microprofile.cdi.Main</mainClass>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${version.h2.db}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-h2</artifactId>
<version>${version.h2.jdbc}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>

View File

@@ -4,13 +4,14 @@
"javax.enterprise.inject.spi.BeanManager",
"org.hibernate.annotations.common.reflection.java.JavaXClass",
"org.hibernate.internal.CoreMessageLogger",
"org.hibernate.persister.entity.AbstractEntityPersister",
"org.hibernate.persister.entity.EntityPersister",
"org.hibernate.resource.beans.container.spi.ExtendedBeanManager",
"org.hibernate.resource.beans.container.internal.CdiBasedBeanContainer",
"org.hibernate.id.IdentifierGenerator",
"org.hibernate.metadata.ClassMetadata",
"org.hibernate.persister.walking.spi.AttributeSource",
"org.hibernate.tuple.Tuplizer"
"org.hibernate.tuple.Tuplizer",
"org.hibernate.persister.collection.CollectionPersister"
],
"classes": [
"org.hibernate.event.spi.LoadEventListener[]",

View File

@@ -49,15 +49,6 @@
}
]
},
{
"name": "org.hibernate.dialect.H2Dialect",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.hibernate.engine.config.internal.ConfigurationServiceImpl",
"allPublicMethods": true

View File

@@ -0,0 +1,5 @@
{
"classes": [
"org.hibernate.dialect.H2Dialect"
]
}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2020 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.
@@ -107,12 +107,7 @@ limitations under the License.
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<groupId>io.helidon.integrations.db</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
@@ -216,7 +211,7 @@ limitations under the License.
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.directory}/libs/h2-${version.h2.db}.jar</argument>
<argument>${project.build.directory}/libs/h2-${version.lib.h2}.jar</argument>
<argument>${mainClassH2}</argument>
<argument>-tcp</argument>
<argument>-tcpPassword</argument>
@@ -225,6 +220,7 @@ limitations under the License.
<argument>${h2.db.port}</argument>
<argument>-baseDir</argument>
<argument>${project.build.directory}/h2</argument>
<argument>-ifNotExists</argument>
</arguments>
<async>true</async>
</configuration>
@@ -239,7 +235,7 @@ limitations under the License.
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<argument>${project.build.directory}/libs/h2-${version.h2.db}.jar</argument>
<argument>${project.build.directory}/libs/h2-${version.lib.h2}.jar</argument>
<argument>${mainClassH2}</argument>
<argument>-tcpShutdown</argument>
<argument>tcp://localhost:${h2.db.port}</argument>

View File

@@ -1,26 +0,0 @@
[
{
"name": "org.hibernate.dialect.H2Dialect",
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "org.h2.engine.Constants",
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allDeclaredFields": true
},
{
"name": "org.hibernate.persister.collection.OneToManyPersister",
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allDeclaredFields": true
},
{
"name": "org.hibernate.persister.collection.BasicCollectionPersister",
"allDeclaredConstructors": true,
"allDeclaredMethods": true,
"allDeclaredFields": true
}
]

View File

@@ -1,28 +0,0 @@
#
# Copyright (c) 2020 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.
#
sources:
- type: "system-properties"
- type: "environment-variables"
- type: "file"
properties:
optional: true
path: "mp-config.yaml"
- type: "classpath"
multi-source: true
properties:
resource: "META-INF/microprofile-config.properties"