diff --git a/README.md b/README.md index 9f0b40c..445019d 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,32 @@ # Library -A simple demo application to show how to work with the default technologies of JavaEE version 7. +A simple demo application to show how to work with the default technologies of JavaEE version 8. This conceptual architecture makes use of the following technologies: -This conceptual architecture makes use of the following technologies: - -The core: - -- Hibernate 5 for JPA 2.1 -- Weld 2.4 for CDI 1.1 -- Mojarra for JSF 2.2 + Primefaces 6.2 + AdminLTE 2.4 + Bootstrap 3 -- Apache Delta Spike Data Module for database querying and repositories functionality +- Java 11 and Java EE 8 with Wildfly 14+ and PostgreSQL 10+ +- Hibernate 5 for JPA 2.2 +- Weld 3.0 for CDI 2.0 +- Mojarra for JSF 2.3 + Primefaces 6.2 + AdminLTE 2.4 + Bootstrap 3 +- Apache Delta Spike JPA and Data Module for database querying and repositories management - Apache Shiro 1.4 through [ShiroEE](https://github.com/arthurgregorio/shiro-ee) for Security with LDAP/AD and database authentication support -- Maven for building and dependency management -- Flyway for database migrations - -The extras: - +- Maven for dependency management and build +- Flyway 5.2 for database migrations - Database audit with Hibernate Envers 5 - Hibernate Validator for Bean Validation -- Omnifaces and PrimefacesExt for JSF utilities -- Jackson for JSON support -- Lombok, Google Guava and Coomons Lang for class level utilities +- Omnifaces 3 and PrimefacesExt for JSF utilities +- Jackson for JSON support +- Lombok, Google Guava and Apache Commons-lang for class level utilities - Mustache for e-mail templating +- Webservices with JAX-RS (RestEasy) -The demo makes use of a custom implementation of [AdminLTE](https://adminlte.io/) integrated with Boostrap 3 and Primefaces for a better UI with modern features and mobile support. +The demo makes use of a custom implementation of [AdminLTE](https://adminlte.io/) integrated with Boostrap 3 and Primefaces for a better UI, modern features and mobile support. -And also, inside the application you can find (already functional) a simple CRUD of Users and User Groups with permission based authentication and LDAP/AD integration with local bind accounts, all of this provided by ShiroEE. +Also, inside the application you can find (already functional) a simple CRUD of Users and User Groups with permission based authentication and LDAP/AD integration with local bind accounts, all of this provided by ShiroEE. -It's not much say, that if you want a **production ready architecture**, this is the project that you are looking for. +It's not much say, that if you want a **production ready architecture**, this is the project you are looking for. ## How to: configure -First of all, you will need to download the latest version of Wildfly application server. This is the homologated version, maybe, with a little bit of changes ~~or no~~ you can run this on Payara, Glassfish or any other JEE 7 server. +First of all, you will need to download the latest version of Wildfly application server. This is the homologated version, maybe, with a little bit of changes ~~or no~~ you can run this on Payara, Glassfish or any other JEE 7+ server. Download Wildfly [here](http://wildfly.org/downloads/) and configure the datasource for the application by editing the ``` standalone.xml``` or ```standalone-full.xml``` (you will know which one to change) to add this lines to the datasource section of the file: @@ -61,7 +56,10 @@ Download Wildfly [here](http://wildfly.org/downloads/) and configure the datasou ``` -And these lines to the mail subsystem (search for ```mail-session```) to enable the demo sending e-mail messages: +> **Quick note**: the datasource will not work if you don't have the PostgreSQL driver enabled in the wildfly modules. To do this, follow [this blog post](https://bok.stenusys.com/index.php/2018/02/12/how_to_setup_postgresql_datasource_with_wildfly/). + + +If you want to send e-mails, these lines should be added to the mail subsystem (search for ```mail-session```): ```xml @@ -77,7 +75,7 @@ And the e-mail socket to the ```socket-binding-group``` at the end of the file: ``` -After this, create the database on you local instance of PostgreSQL 9+ to match the Wildfly configurations and enable the deployment of the application: +After this, create the database on you local instance of PostgreSQL 10+ to match the Wildfly configurations and enable the deployment of the application: ```sql -- the user @@ -101,7 +99,15 @@ CREATE USER sa_library WITH CONNECTION LIMIT = -1; ``` -The tables and the initial data (default user, group and authorizations) will be created by Flyway with the migrations strategy. +The tables and the initial data (default user, group and authorizations) will be created by Flyway with the migrations strategy. If you want to run this application +in development mode, Hibernate will create the tables, but you should create the schemes by hands on PgAdmin or another similar software: + +```sql +CREATE SCHEMA configuration AUTHORIZATION sa_library; +CREATE SCHEMA registration AUTHORIZATION sa_library; +CREATE SCHEMA configuration_audit AUTHORIZATION sa_library; +CREATE SCHEMA registration_audit AUTHORIZATION sa_library; +``` ## How to: run on IDE @@ -112,42 +118,15 @@ Just import the maven project and deploy to you already configured Wildfly serve Build the project. On the root folder run: ```shell -mvn clean package +mvn clean package -Prelease ``` -This will trigger the maven build to work with the default profile, *ALPHA*, with the following configurations available on the *pom.xml* file: - -```xml - - ALPHA - - true - - - - ${project.version}-ALPHA - - false - Development - false - ldap://localhost - OU=Usuarios,DC=arthurgregorio,DC=eti,DC=br - CN=usuaribind,OU=Aplicacoes,DC=arthurgregorio,DC=eti,DC=br - minha-senha - - -``` +If no profile is used, this will tell maven to build the development version with no migrations and the database need to be initialized manually like is said above. -The configuration also have other profiles for you to configure according to your need: +The build configuration also have other profiles for you to configure according to your need: - *BETA* for beta releases - *RC* for release candidate releases - *RELEASE* for the final, production ready releases -To use a specific profile, run the maven build with: - -```shell -mvn -P(the-profile) clean package -``` - -After the build, open the wildfly admin console on the web browser and in the deployments section, upload the war file created by the build in the target folder (named *library-1.0.0-(selected-profile)*) inside the project and access it on the default URL: https://localhost:8080/, and you're done! Enjoy the demo. +After the build, open the wildfly admin console on the web browser and in the deployments section, upload the war file created by the build in the target folder (named *library-1.0.0-(selected-profile)*) inside the project and access it on the default URL: https://localhost:8443/, and you're done! Enjoy the demo. \ No newline at end of file