An open API service indexing awesome lists of open source software.

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

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]