Java EE 8 + Self-Contained Gradle Build + CI Pipeline

This application demonstrates the following technologies put together

  • JEE 8
    • CDI
    • JSF
    • TODO: add more JEE features ( Security, Jax-RS, JPA, Messaging, RxJava?? ....)
  • Self-contained build/test Gradle script. Running this application does't require any JEE 8 Server pre-installed on your local dev computer.
  • TODO: Helm chart for deployment on a Kubernetes cluster
  • TODO: CI/CD Pipeline (Jenkins file or similar setup)

Prerequisite

Build and Run

Start the application:


gradlew libertyRun

Then go to: http://localhost:9080/cwgenJsf/

Stop the server:


gradlew libertyStop

TODO: add docker, helm, etc...

About the Application Itself

It is an application which generates a word search puzzle, can also be used to generate crossword puzzle. User should specify the following parameters:

  • rows of the board
  • columns of the board
  • density of the board to be filled (should be a value between 0.1 to 1.0)
  • shortest length of words allowed in the board

You can find the API specification here: Crossword Generator OpenAPI spec More about the generator: https://github.com/nnworkspace/crossword-gen-java

Docker Commands

Prepare: gradlew war

Build: docker build -t nnworkspace/crossword-jsf:latest -t nnworkspace/crossword-jsf:v0.2 .

Check images: docker image ls

Run the application from docker: docker run -it -p 80:9080 -p 443:9443 nnworkspace/crossword-jsf:latest

Stop a running container: docker stop <container id/name>

Start a stopped container: docker start <container id/name>

Access the application: http://localhost:80/cwgenJsf

NOTE: The context root string cwgenJsf is in the file build.gradle specified. By every build, the Gradle plugin liberty-gradle-plugin will generate a bootstrap.properties file, which has a property app.context.root=cwgenJsf. The generated bootstrap.properties can be found in the path ./build/wlp/usr/servers/defaultServer/bootstrap.properties.

Documentation

To generate the documentation you need Python 3 and the pip packages mkdocs and mkdocs-material installed as a prerequisite.

pip install mkdocs mkdocs-material

From there on you can run gradlew docs to generate the latest documentation in the site directory.

Special Thanks and Further Reading