generated from oracle-devrel/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 3
init for graalvm workshops - spring boot, quarkus, micronaut, helidon #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
fde5342
remove oci limits checks
paulparkinson 7d85056
remove oci limits checks
paulparkinson 99394b2
remove oci limits checks
paulparkinson 75cdf7a
Merge remote-tracking branch 'upstream/main'
paulparkinson 262ca15
init for graalvm workshops
paulparkinson 8b2a4c8
init for graalvm workshops
paulparkinson cce1ecf
init for graalvm workshops
paulparkinson fffc721
init for graalvm workshops
paulparkinson ab303ef
init for graalvm workshops
paulparkinson 9636354
init for graalvm workshops
paulparkinson 8223090
init for graalvm workshops
paulparkinson 7617e3c
init for graalvm workshops
paulparkinson fe3e90e
init for graalvm workshops
paulparkinson 54899b2
init for graalvm workshops
paulparkinson 33047ed
init for graalvm workshops
paulparkinson f0efd5c
init for graalvm workshops
paulparkinson ec91eee
init for graalvm workshops
paulparkinson 232bca3
init for graalvm workshops
paulparkinson 93744df
init for graalvm workshops
paulparkinson 558dc04
init for graalvm workshops
paulparkinson 62a1b70
init for graalvm workshops
paulparkinson da08557
init for graalvm workshops
paulparkinson e7bcb58
init for graalvm workshops
paulparkinson e7847ad
init for graalvm workshops
paulparkinson 901e1b8
init for graalvm workshops
paulparkinson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 | ||
https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.helidon.applications</groupId> | ||
<artifactId>helidon-mp</artifactId> | ||
<version>4.1.1</version> | ||
<relativePath/> | ||
</parent> | ||
<groupId>com.oracle.helidon.datasource</groupId> | ||
<artifactId>com-oracle-helidon-datasource</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
|
||
<dependencies> | ||
<!-- Compile-scoped dependencies. --> | ||
<dependency> | ||
<groupId>jakarta.enterprise</groupId> | ||
<artifactId>jakarta.enterprise.cdi-api</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>jakarta.ws.rs</groupId> | ||
<artifactId>jakarta.ws.rs-api</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.microprofile.config</groupId> | ||
<artifactId>microprofile-config-api</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
|
||
<!-- Runtime-scoped dependencies. --> | ||
<dependency> | ||
<groupId>io.helidon.integrations.db</groupId> | ||
<artifactId>ojdbc</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.integrations.cdi</groupId> | ||
<artifactId>helidon-integrations-cdi-datasource-ucp</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.smallrye</groupId> | ||
<artifactId>jandex</artifactId> | ||
<scope>runtime</scope> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.microprofile.server</groupId> | ||
<artifactId>helidon-microprofile-server</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.microprofile.config</groupId> | ||
<artifactId>helidon-microprofile-config</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>copy-libs</id> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.smallrye</groupId> | ||
<artifactId>jandex-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>make-index</id> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
77 changes: 77 additions & 0 deletions
77
graalvm-nativeimage/helidon/src/main/java/com/oracle/helidon/datasource/TablesResource.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
package com.oracle.helidon.datasource; | ||
|
||
import java.sql.Connection; | ||
import java.sql.PreparedStatement; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.util.Objects; | ||
|
||
import javax.sql.DataSource; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.inject.Inject; | ||
import jakarta.inject.Named; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
/** | ||
* A JAX-RS resource class in {@linkplain ApplicationScoped | ||
* application scope} rooted at {@code /tables}. | ||
* | ||
* @see #get() | ||
*/ | ||
@Path("/tables") | ||
@ApplicationScoped | ||
public class TablesResource { | ||
|
||
private final DataSource dataSource; | ||
|
||
/** | ||
* Creates a new {@link TablesResource}. | ||
* | ||
* @param dataSource the {@link DataSource} to use to acquire | ||
* database table names; must not be {@code null} | ||
* | ||
* @exception NullPointerException if {@code dataSource} is {@code | ||
* null} | ||
*/ | ||
@Inject | ||
public TablesResource(@Named("example") final DataSource dataSource) { | ||
super(); | ||
this.dataSource = Objects.requireNonNull(dataSource); | ||
} | ||
|
||
/** | ||
* Returns a {@link Response} which, if successful, contains a | ||
* newline-separated list of Oracle database table names. | ||
* | ||
* <p>This method never returns {@code null}.</p> | ||
* | ||
* @return a non-{@code null} {@link Response} | ||
* | ||
* @exception SQLException if a database error occurs | ||
*/ | ||
@GET | ||
@Produces(MediaType.TEXT_PLAIN) | ||
public Response get() throws SQLException { | ||
final StringBuilder sb = new StringBuilder(); | ||
try (Connection connection = this.dataSource.getConnection(); | ||
PreparedStatement ps = | ||
connection.prepareStatement(" SELECT TABLE_NAME" | ||
+ " FROM ALL_TABLES " | ||
+ "ORDER BY TABLE_NAME ASC"); | ||
ResultSet rs = ps.executeQuery()) { | ||
while (rs.next()) { | ||
sb.append(rs.getString(1)).append("\n"); | ||
} | ||
} | ||
final Response returnValue = Response.ok() | ||
.entity(sb.toString()) | ||
.build(); | ||
return returnValue; | ||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
graalvm-nativeimage/helidon/src/main/resources/META-INF/beans.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee | ||
https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd" | ||
version="4.0" | ||
bean-discovery-mode="annotated"> | ||
</beans> |
7 changes: 7 additions & 0 deletions
7
...tiveimage/helidon/src/main/resources/META-INF/helidon/native-image/reflection-config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"classes": [ | ||
"oracle.ucp.jdbc.PoolDataSource", | ||
"oracle.ucp.jdbc.PoolDataSourceImpl", | ||
"javax.sql.DataSource" | ||
] | ||
} |
30 changes: 30 additions & 0 deletions
30
...vm-nativeimage/helidon/src/main/resources/META-INF/helidon/native-image/weld-proxies.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[ | ||
{ | ||
"bean-class": "io.helidon.integrations.datasource.ucp.cdi.UCPBackedDataSourceExtension", | ||
"ifaces": [ | ||
"java.io.Serializable", | ||
"java.sql.Wrapper", | ||
"javax.naming.Referenceable", | ||
"javax.naming.spi.ObjectFactory", | ||
"javax.sql.CommonDataSource", | ||
"javax.sql.DataSource", | ||
"oracle.ucp.jdbc.PoolDataSource", | ||
"oracle.ucp.UniversalConnectionPoolAdapter" | ||
] | ||
}, | ||
{ | ||
"bean-class": "io.helidon.integrations.datasource.ucp.cdi.UniversalConnectionPoolExtension", | ||
"ifaces": [ | ||
"java.io.Serializable", | ||
"java.sql.Wrapper", | ||
"javax.naming.Referenceable", | ||
"javax.naming.spi.ObjectFactory", | ||
"javax.sql.CommonDataSource", | ||
"javax.sql.DataSource", | ||
"javax.sql.XADataSource", | ||
"oracle.ucp.jdbc.PoolDataSource", | ||
"oracle.ucp.jdbc.PoolXADataSource", | ||
"oracle.ucp.UniversalConnectionPoolAdapter" | ||
] | ||
} | ||
] |
11 changes: 11 additions & 0 deletions
11
graalvm-nativeimage/helidon/src/main/resources/META-INF/microprofile-config.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Microprofile server properties | ||
server.port=8080 | ||
server.host=0.0.0.0 | ||
|
||
# DataSource properties | ||
javax.sql.DataSource.example.connectionFactoryClassName=oracle.jdbc.pool.OracleDataSource | ||
#javax.sql.DataSource.example.URL=jdbc:oracle:thin:@<ATP_NAME>_high?TNS_ADMIN=/home/<YOUR_USER>/<YOUR_WALLET_LOCATION> | ||
javax.sql.DataSource.example.URL=jdbc:oracle:thin:@ATP110345_high?TNS_ADMIN=/home/LL110345_U/myatpwallet | ||
javax.sql.DataSource.example.user=ADMIN | ||
javax.sql.DataSource.example.password=##03pRivvzR2q4jv | ||
#javax.sql.DataSource.example.password=<ADMIN_PASSWORD> |
4 changes: 4 additions & 0 deletions
4
...image/com.oracle.helidon.datasource/com-oracle-helidon-datasource/native-image.properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Args=-H:+RemoveSaturatedTypeFlows --initialize-at-build-time=com.oracle.helidon.datasource \ | ||
--initialize-at-run-time=io.helidon.integrations.datasource.ucp.cdi.UniversalConnectionPool$_$$_WeldClientProxy \ | ||
--initialize-at-run-time=oracle.jdbc.driver.NTFListener \ | ||
--initialize-at-run-time=oracle.ucp.common.Service |
10 changes: 10 additions & 0 deletions
10
...ive-image/com.oracle.helidon.datasource/com-oracle-helidon-datasource/reflect-config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"name": "oracle.ucp.jdbc.PoolDataSourceImpl", | ||
"allPublicMethods" : true | ||
}, | ||
{ | ||
"name" : "oracle.ucp.jdbc.PoolXADataSourceImpl", | ||
"allPublicMethods" : true | ||
} | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# AOT configuration properties for jar packaging | ||
# Please review carefully the optimizations enabled below | ||
# Check https://micronaut-projects.github.io/micronaut-aot/latest/guide/ for more details | ||
|
||
# Caches environment property values: environment properties will be deemed immutable after application startup. | ||
cached.environment.enabled=true | ||
|
||
# Precomputes Micronaut configuration property keys from the current environment variables | ||
precompute.environment.properties.enabled=true | ||
|
||
# Converts YAML configuration files to Java configuration | ||
yaml.to.java.config.enabled=true | ||
|
||
# Scans for service types ahead-of-time, avoiding classpath scanning at startup | ||
serviceloading.jit.enabled=true | ||
|
||
# Scans reactive types at build time instead of runtime | ||
scan.reactive.types.enabled=true | ||
|
||
# Deduces the environment at build time instead of runtime | ||
deduce.environment.enabled=true | ||
|
||
# Checks of existence of some types at build time instead of runtime | ||
known.missing.types.enabled=true | ||
|
||
# Precomputes property sources at build time | ||
sealed.property.source.enabled=true | ||
|
||
# The list of service types to be scanned (comma separated) | ||
service.types=io.micronaut.context.env.PropertySourceLoader,io.micronaut.inject.BeanConfiguration,io.micronaut.inject.BeanDefinitionReference,io.micronaut.http.HttpRequestFactory,io.micronaut.http.HttpResponseFactory,io.micronaut.core.beans.BeanIntrospectionReference,io.micronaut.core.convert.TypeConverterRegistrar,io.micronaut.context.env.PropertyExpressionResolver | ||
|
||
# A list of types that the AOT analyzer needs to check for existence (comma separated) | ||
known.missing.types.list=io.reactivex.Observable,reactor.core.publisher.Flux,kotlinx.coroutines.flow.Flow,io.reactivex.rxjava3.core.Flowable,io.reactivex.rxjava3.core.Observable,io.reactivex.Single,reactor.core.publisher.Mono,io.reactivex.Maybe,io.reactivex.rxjava3.core.Single,io.reactivex.rxjava3.core.Maybe,io.reactivex.Completable,io.reactivex.rxjava3.core.Completable,io.methvin.watchservice.MacOSXListeningWatchService,io.micronaut.core.async.publisher.CompletableFuturePublisher,io.micronaut.core.async.publisher.Publishers.JustPublisher,io.micronaut.core.async.subscriber.Completable | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
applicationType: default | ||
defaultPackage: com.oracle.dev.jdbc.micronaut | ||
testFramework: junit | ||
sourceLanguage: java | ||
buildTool: maven | ||
features: [app-name, data, data-jdbc, flyway, http-client-test, java, java-application, jdbc-hikari, junit, logback, maven, maven-enforcer-plugin, micronaut-aot, micronaut-http-validation, netty-server, oracle-cloud-atp, oracle-cloud-sdk, properties, readme, serialization-jackson, shade, testcontainers] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This password is exposed at the moment, could you hide it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it