The simple Demo applications done with Helidon MP 4.x
It's based on Helidon MP's "Pokemon" demo app, but the original demo has been expanded to make it more "realistic".
(however REST API are 100% same)
- HikariCP + JPA + JTA + EclipseLink
- More "clean" persistence.xml
- exclude-unlisted-classes=true
- shared-cache-mode=ENABLE_SELECTIVE
- eclipselink.weaving=static
- eclipselink.target-database dropped
- Produces and use qualified EntityManager (not default)
- Used Apache DeltaSpike Data
- Yes, this is "Spring-style" Repository interfaces
- with ContainerManagedTransactionStrategy
- with EntityManagerResolver for qualified EntityManager
- HikariCP + Jdbi 3
SLF4J + Logback instead of JUL
- persistence.xml: eclipselink.logging.logger=org.eclipse.persistence.logging.slf4j.SLF4JLogger
- This logger is taken from the org.eclipse.persistence:org.eclipse.persistence.extension library
- JUL -> SLF4JBridge (Apache DeltaSpike Data; Jersey; etc. are using JUL, so it must be "redirected" to SLF4J)
- for Unit tests: src/test/resources/logging.properties: handlers=org.slf4j.bridge.SLF4JBridgeHandler
- the Main class setup JUL -> SLF4JBridge programmatically
- logback.xml & logback-text.xml
- Avoid to use hamcrest Library (not necessary at all for the demo application)
- src/test/resources/META-INF/microprofile-config.properties: config_ordinal=1000 (to override "main" configuation file)
- Unit tests are using Zonkyio Embedded Postgres
- with Flyway
- Made a custom JUnit5 Extension to run a single Embedded Postgres instance for all test classes
- So, just for demo the application is using Embedded Postgres for unit-tests, but H2 for "productive" run :)
Original demo app do not have "Main" class but here we have one
- To setup JUL -> SLF4JBridge
- To run Flyway before server start
- Set finalName=${project.artifactId}-${project.version}
- Added .mvn folder
- Set mainClass=net.cactusthorn.helidonmp.demo.Main
- Use maven-assembly-plugin to generat ZIP artifact with all Lib and the application
- target/helidonmp-demo-1.0.0-full.zip
- A simple way to create the atifact that contains everything an application needs at runtime and can be placed in, for example, an Artifactory
- Use Flyway for DB setup
- Original Message class converted to record
- More clean .gitattributes & .gitignore