Skip to content

Commit f5e27c2

Browse files
fix #40
1 parent 7327870 commit f5e27c2

File tree

1 file changed

+34
-55
lines changed

1 file changed

+34
-55
lines changed

README.md

Lines changed: 34 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
11
# Library
22

3-
A simple demo application to show how to work with the default technologies of JavaEE version 7.
3+
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:
44

5-
This conceptual architecture makes use of the following technologies:
6-
7-
The core:
8-
9-
- Hibernate 5 for JPA 2.1
10-
- Weld 2.4 for CDI 1.1
11-
- Mojarra for JSF 2.2 + Primefaces 6.2 + AdminLTE 2.4 + Bootstrap 3
12-
- Apache Delta Spike Data Module for database querying and repositories functionality
5+
- Java 11 and Java EE 8 with Wildfly 14+ and PostgreSQL 10+
6+
- Hibernate 5 for JPA 2.2
7+
- Weld 3.0 for CDI 2.0
8+
- Mojarra for JSF 2.3 + Primefaces 6.2 + AdminLTE 2.4 + Bootstrap 3
9+
- Apache Delta Spike JPA and Data Module for database querying and repositories management
1310
- Apache Shiro 1.4 through [ShiroEE](https://github.com/arthurgregorio/shiro-ee) for Security with LDAP/AD and database authentication support
14-
- Maven for building and dependency management
15-
- Flyway for database migrations
16-
17-
The extras:
18-
11+
- Maven for dependency management and build
12+
- Flyway 5.2 for database migrations
1913
- Database audit with Hibernate Envers 5
2014
- Hibernate Validator for Bean Validation
21-
- Omnifaces and PrimefacesExt for JSF utilities
22-
- Jackson for JSON support
23-
- Lombok, Google Guava and Coomons Lang for class level utilities
15+
- Omnifaces 3 and PrimefacesExt for JSF utilities
16+
- Jackson for JSON support
17+
- Lombok, Google Guava and Apache Commons-lang for class level utilities
2418
- Mustache for e-mail templating
19+
- Webservices with JAX-RS (RestEasy)
2520

26-
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.
21+
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.
2722

28-
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.
23+
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.
2924

30-
It's not much say, that if you want a **production ready architecture**, this is the project that you are looking for.
25+
It's not much say, that if you want a **production ready architecture**, this is the project you are looking for.
3126

3227
## How to: configure
3328

34-
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.
29+
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.
3530

3631
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:
3732

@@ -61,7 +56,10 @@ Download Wildfly [here](http://wildfly.org/downloads/) and configure the datasou
6156
</datasource>
6257
```
6358

64-
And these lines to the mail subsystem (search for ```mail-session```) to enable the demo sending e-mail messages:
59+
> **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/).
60+
61+
62+
If you want to send e-mails, these lines should be added to the mail subsystem (search for ```mail-session```):
6563

6664
```xml
6765
<mail-session name="my-email" debug="true" jndi-name="java:/mail/library" from="no-reply@my-email-account.com">
@@ -77,7 +75,7 @@ And the e-mail socket to the ```socket-binding-group``` at the end of the file:
7775
</outbound-socket-binding>
7876
```
7977

80-
After this, create the database on you local instance of PostgreSQL 9+ to match the Wildfly configurations and enable the deployment of the application:
78+
After this, create the database on you local instance of PostgreSQL 10+ to match the Wildfly configurations and enable the deployment of the application:
8179

8280
```sql
8381
-- the user
@@ -101,7 +99,15 @@ CREATE USER sa_library WITH
10199
CONNECTION LIMIT = -1;
102100
```
103101

104-
The tables and the initial data (default user, group and authorizations) will be created by Flyway with the migrations strategy.
102+
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
103+
in development mode, Hibernate will create the tables, but you should create the schemes by hands on PgAdmin or another similar software:
104+
105+
```sql
106+
CREATE SCHEMA configuration AUTHORIZATION sa_library;
107+
CREATE SCHEMA registration AUTHORIZATION sa_library;
108+
CREATE SCHEMA configuration_audit AUTHORIZATION sa_library;
109+
CREATE SCHEMA registration_audit AUTHORIZATION sa_library;
110+
```
105111

106112
## How to: run on IDE
107113

@@ -112,42 +118,15 @@ Just import the maven project and deploy to you already configured Wildfly serve
112118
Build the project. On the root folder run:
113119

114120
```shell
115-
mvn clean package
121+
mvn clean package -Prelease
116122
```
117123

118-
This will trigger the maven build to work with the default profile, *ALPHA*, with the following configurations available on the *pom.xml* file:
119-
120-
```xml
121-
<profile>
122-
<id>ALPHA</id>
123-
<activation>
124-
<activeByDefault>true</activeByDefault>
125-
</activation>
126-
<properties>
127-
<application.version>
128-
${project.version}-ALPHA
129-
</application.version>
130-
<skip.tests>false</skip.tests>
131-
<jsf.stage>Development</jsf.stage>
132-
<ldap.enabled>false</ldap.enabled>
133-
<ldap.url>ldap://localhost</ldap.url>
134-
<ldap.baseDn>OU=Usuarios,DC=arthurgregorio,DC=eti,DC=br</ldap.baseDn>
135-
<ldap.user>CN=usuaribind,OU=Aplicacoes,DC=arthurgregorio,DC=eti,DC=br</ldap.user>
136-
<ldap.password>minha-senha</ldap.password>
137-
</properties>
138-
</profile>
139-
```
124+
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.
140125

141-
The configuration also have other profiles for you to configure according to your need:
126+
The build configuration also have other profiles for you to configure according to your need:
142127

143128
- *BETA* for beta releases
144129
- *RC* for release candidate releases
145130
- *RELEASE* for the final, production ready releases
146131

147-
To use a specific profile, run the maven build with:
148-
149-
```shell
150-
mvn -P(the-profile) clean package
151-
```
152-
153-
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.
132+
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.

0 commit comments

Comments
 (0)