https://github.com/daggerok/payara-micro-example
This is a simple Payara MicroProfile project by using maven and gradle build tools compiling and running on top of Java 8 and Java 11. Gradle payara-micro uber-jar build automation (see payara.gradle build file for details) Read more about micro-profile initiative: https://microprofile.io
https://github.com/daggerok/payara-micro-example
buildsrc eclipsel fatjar gradle gradle-kotlin-dsl h2 h2-database javaee javaee7 javaee8 jdk11 jdk8 jpa liquibase logging microprofile payara payara-micro slf4j uberjar
Last synced: 6 months ago
JSON representation
This is a simple Payara MicroProfile project by using maven and gradle build tools compiling and running on top of Java 8 and Java 11. Gradle payara-micro uber-jar build automation (see payara.gradle build file for details) Read more about micro-profile initiative: https://microprofile.io
- Host: GitHub
- URL: https://github.com/daggerok/payara-micro-example
- Owner: daggerok
- License: mit
- Created: 2018-11-06T03:03:11.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-03-08T21:17:29.000Z (almost 4 years ago)
- Last Synced: 2025-01-10T00:43:14.675Z (12 months ago)
- Topics: buildsrc, eclipsel, fatjar, gradle, gradle-kotlin-dsl, h2, h2-database, javaee, javaee7, javaee8, jdk11, jdk8, jpa, liquibase, logging, microprofile, payara, payara-micro, slf4j, uberjar
- Language: Java
- Homepage:
- Size: 228 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= payara-micro-example image:https://travis-ci.org/daggerok/payara-micro-example.svg?branch=master["Build Status", link="https://travis-ci.org/daggerok/payara-micro-example"]
This is a simple Payara MicroProfile project by using maven and gradle build tools compiling and running on top of
Java 8 and Java 11
== features
* payara-micro
* fatJar / uberJar
* JPA eclipselink
* H2 database
* Liquibase
* slf4j logging
.build ROOT.war and deploy it into *-microbundle.jar
[source,bash]
----
./gradlew clean bundle
ls -lah ./build | grep jar
----
.run (with remote debug for example)
[source,bash]
----
java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 \
-Djava.net.preferIPv4Stack=true \
./build/libs/*-microbundle.jar
----
.test: post new data
[source,bash]
----
http :8080/v1 string=one
http :8080/v1 string=two
http :8080/v1 string=3
----
.test
[source,http]
----
HTTP/1.1 202 Accepted
Content-Length: 0
Server: Payara Micro #badassfish
X-Frame-Options: SAMEORIGIN
----
.test
[source,bash]
----
http :8080/v1
----
.test
[source,http]
----
HTTP/1.1 200 OK
Content-Length: 17
Content-Type: application/json
Server: Payara Micro #badassfish
X-Frame-Options: SAMEORIGIN
----
.verify
[source,json]
----
[
"two",
"one",
"3"
]
----
.using gradle is very similar to maven
[source,bash]
----
./gradlew bundle
./gradlew start
# or
java -jar build/libs/*-microbindle.jar
----
TIP: see link:https://github.com/daggerok/payara-micro-example/blob/master/build.gradle.kts#L25[Payara Gradle] build file for details.
.maven usage
[source,bash]
----
./mvnw -Pbundle
./mvnw -Pstart
# or
java -jar target/*-microbundle.jar
----
== my other payara-related repositories
* link:https://github.com/daggerok/kotlin-payara-micro-profile[GitHub: daggerok/kotlin-payara-micro-profile]
* link:https://github.com/daggerok/payara-micro-gradle-no-plugin[GitHub: daggerok/payara-micro-gradle-no-plugin]
* link:https://github.com/daggerok/payara-micro-gradle-plugin-build-script[GitHub: daggerok/payara-micro-gradle-plugin-build-script]
* link:https://github.com/daggerok/maven-java-projects[GitHub: daggerok/maven-java-projects]
* link:https://github.com/daggerok/generator-jvm[GitHub: daggerok/generator-jvm]
* link:https://github.com/daggerok/payara-micro-example[GitHub: daggerok/payara-micro-example]
* link:https://github.com/daggerok/microprofile-examples[GitHub: daggerok/microprofile-examples]
== resources
- see more about link:https://wiki.eclipse.org/MicroProfile/Implementation[MicroProfiles]
- link:https://docs.payara.fish/documentation/ecosystem/gradle-plugin.html[Payara Gradle plugin]
- link:https://www.liquibase.org/documentation/includeall.html[Liquibase]
- link:https://wiki.eclipse.org/EclipseLink/Examples[EclipseLink Examples]
- link:https://www.eclipse.org/eclipselink/documentation/2.5/jpa/extensions/p_ddl_generation.htm[EclipseLink DDL]