-
Notifications
You must be signed in to change notification settings - Fork 92
Doc and sample updates for 1.4.0 #1076
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
Draft
markxnelson
wants to merge
10
commits into
main
Choose a base branch
from
mark/1.4.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c6328c5
starting point
markxnelson 2f44332
starting point
markxnelson 942d2c4
working on doc updates
markxnelson 0dcb6c2
enable hibernate to create tables
ddrechse c15e92b
Merge branch 'mark/1.4.0' of github.com:oracle/microservices-datadriv…
ddrechse d7c74ac
Clean up of file
ddrechse 03b0a84
Revert "Merge branch 'mark/1.4.0' of github.com:oracle/microservices-…
ddrechse 6387130
Enable Helidon Table Creation (#1078)
ddrechse 110b73e
Fix customer api (#1079)
ddrechse facd9f7
Merge branch 'main' into mark/1.4.0
markxnelson 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 @@ | ||
target/* |
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,36 @@ | ||
# Compiled class file | ||
*.class | ||
|
||
# Maven | ||
target/ | ||
.m2/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.nar | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# IntelliJ Idea | ||
.idea/* | ||
!.idea/runConfigurations | ||
*.iws | ||
*.ipr | ||
*.iml | ||
*.releaseBackup | ||
atlassian-ide-plugin.xml | ||
|
||
# Netbeans | ||
nbactions.xml | ||
nb-configuration.xml | ||
|
||
# Eclipse | ||
.settings | ||
.settings/ | ||
.project | ||
.classpath | ||
.factorypath | ||
|
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 @@ | ||
#Helidon Project Configuration | ||
#Wed Jun 18 10:11:56 EDT 2025 | ||
schema.version=1.1.0 | ||
helidon.version=4.2.3 | ||
project.flavor=mp | ||
project.archetype=quickstart |
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,39 @@ | ||
|
||
# 1st stage, build the app | ||
FROM container-registry.oracle.com/java/jdk-no-fee-term:21 as build | ||
|
||
# Install maven | ||
WORKDIR /usr/share | ||
RUN set -x && \ | ||
curl -O https://archive.apache.org/dist/maven/maven-3/3.8.4/binaries/apache-maven-3.8.4-bin.tar.gz && \ | ||
tar -xvf apache-maven-*-bin.tar.gz && \ | ||
rm apache-maven-*-bin.tar.gz && \ | ||
mv apache-maven-* maven && \ | ||
ln -s /usr/share/maven/bin/mvn /bin/ | ||
|
||
WORKDIR /helidon | ||
|
||
# Create a first layer to cache the "Maven World" in the local repository. | ||
# Incremental docker builds will always resume after that, unless you update | ||
# the pom | ||
ADD pom.xml . | ||
RUN mvn package -Dmaven.test.skip -Declipselink.weave.skip -Declipselink.weave.skip -DskipOpenApiGenerate | ||
|
||
# Do the Maven build! | ||
# Incremental docker builds will resume here when you change sources | ||
ADD src src | ||
Check noticeCode scanning / SonarCloud Prefer COPY over ADD for copying local resources Low
Replace this ADD instruction with a COPY instruction. See more on SonarQube Cloud
|
||
RUN mvn package -DskipTests | ||
|
||
RUN echo "done!" | ||
|
||
# 2nd stage, build the runtime image | ||
FROM container-registry.oracle.com/java/jdk-no-fee-term:21 | ||
WORKDIR /helidon | ||
|
||
# Copy the binary built in the 1st stage | ||
COPY --from=build /helidon/target/customer-helidon.jar ./ | ||
COPY --from=build /helidon/target/libs ./libs | ||
|
||
CMD ["java", "-jar", "customer-helidon.jar"] | ||
|
||
EXPOSE 8080 |
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,94 @@ | ||
# customer-helidon | ||
|
||
Helidon MP version of the "customer" microservice. | ||
|
||
## Build and run | ||
|
||
|
||
With JDK21 | ||
```bash | ||
mvn package | ||
java -jar target/customer-helidon.jar | ||
``` | ||
|
||
## Exercise the application | ||
|
||
Basic: | ||
``` | ||
curl -X GET http://localhost:8080/simple-greet | ||
Hello World! | ||
``` | ||
|
||
|
||
JSON: | ||
``` | ||
curl -X GET http://localhost:8080/greet | ||
{"message":"Hello World!"} | ||
|
||
curl -X GET http://localhost:8080/greet/Joe | ||
{"message":"Hello Joe!"} | ||
|
||
curl -X PUT -H "Content-Type: application/json" -d '{"greeting" : "Hola"}' http://localhost:8080/greet/greeting | ||
|
||
curl -X GET http://localhost:8080/greet/Jose | ||
{"message":"Hola Jose!"} | ||
``` | ||
|
||
|
||
|
||
## Try health | ||
|
||
``` | ||
curl -s -X GET http://localhost:8080/health | ||
{"outcome":"UP",... | ||
|
||
``` | ||
|
||
|
||
## Building a Native Image | ||
|
||
The generation of native binaries requires an installation of GraalVM 22.1.0+. | ||
|
||
You can build a native binary using Maven as follows: | ||
|
||
``` | ||
mvn -Pnative-image install -DskipTests | ||
``` | ||
|
||
The generation of the executable binary may take a few minutes to complete depending on | ||
your hardware and operating system. When completed, the executable file will be available | ||
under the `target` directory and be named after the artifact ID you have chosen during the | ||
project generation phase. | ||
|
||
|
||
|
||
## Try metrics | ||
|
||
``` | ||
# Prometheus Format | ||
curl -s -X GET http://localhost:8080/metrics | ||
# TYPE base:gc_g1_young_generation_count gauge | ||
. . . | ||
|
||
# JSON Format | ||
curl -H 'Accept: application/json' -X GET http://localhost:8080/metrics | ||
{"base":... | ||
. . . | ||
``` | ||
|
||
|
||
|
||
## Building the Docker Image | ||
|
||
``` | ||
docker build -t customer-helidon . | ||
``` | ||
|
||
## Running the Docker Image | ||
|
||
``` | ||
docker run --rm -p 8080:8080 customer-helidon:latest | ||
``` | ||
|
||
Exercise the application as described above. | ||
|
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,206 @@ | ||
<?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.2.3</version> | ||
<relativePath/> | ||
</parent> | ||
<groupId>com.example</groupId> | ||
<artifactId>customer-helidon</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.helidon.microprofile.bundles</groupId> | ||
<artifactId>helidon-microprofile-core</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.integrations.cdi</groupId> | ||
<artifactId>helidon-integrations-cdi-datasource-ucp</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.integrations.db</groupId> | ||
<artifactId>ojdbc</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>jakarta.transaction</groupId> | ||
<artifactId>jakarta.transaction-api</artifactId> | ||
<!-- <scope>provided</scope> --> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.integrations.cdi</groupId> | ||
<artifactId>helidon-integrations-cdi-jta-weld</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>jakarta.persistence</groupId> | ||
<artifactId>jakarta.persistence-api</artifactId> | ||
<!-- <scope>provided</scope> --> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.integrations.cdi</groupId> | ||
<artifactId>helidon-integrations-cdi-jpa</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.integrations.cdi</groupId> | ||
<artifactId>helidon-integrations-cdi-hibernate</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.hibernate</groupId> | ||
<artifactId>hibernate-core</artifactId> | ||
<version>${version.lib.hibernate}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.microprofile.openapi</groupId> | ||
<artifactId>helidon-microprofile-openapi</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.microprofile.health</groupId> | ||
<artifactId>helidon-microprofile-health</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>jakarta.json.bind</groupId> | ||
<artifactId>jakarta.json.bind-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.glassfish.jersey.media</groupId> | ||
<artifactId>jersey-media-json-binding</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.logging</groupId> | ||
<artifactId>helidon-logging-jul</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.smallrye</groupId> | ||
<artifactId>jandex</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.microprofile.metrics</groupId> | ||
<artifactId>microprofile-metrics-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.microprofile.metrics</groupId> | ||
<artifactId>helidon-microprofile-metrics</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.helidon.microprofile.testing</groupId> | ||
<artifactId>helidon-microprofile-testing-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.hamcrest</groupId> | ||
<artifactId>hamcrest-all</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- Minimal test dependencies for pure unit testing --> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-api</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
<version>5.5.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-junit-jupiter</artifactId> | ||
<version>5.5.0</version> | ||
<scope>test</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> | ||
<plugin> | ||
<groupId>org.hibernate.orm.tooling</groupId> | ||
<artifactId>hibernate-enhance-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>Statically enhance JPA entities for Hibernate</id> | ||
<phase>compile</phase> | ||
<goals> | ||
<goal>enhance</goal> | ||
</goals> | ||
<configuration> | ||
<failOnError>true</failOnError> | ||
<enableDirtyTracking>true</enableDirtyTracking> | ||
<enableLazyInitialization>true</enableLazyInitialization> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
|
||
<pluginManagement> | ||
<plugins> | ||
|
||
<!-- ... --> | ||
|
||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>default-compile</id> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<annotationProcessorPath> | ||
<groupId>org.hibernate.orm</groupId> | ||
<artifactId>hibernate-jpamodelgen</artifactId> | ||
<version>${version.lib.hibernate}</version> | ||
</annotationProcessorPath> | ||
</annotationProcessorPaths> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<!-- ... --> | ||
|
||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
|
||
</project> |
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.
Check notice
Code scanning / SonarCloud
Prefer COPY over ADD for copying local resources Low