开源软件名称(OpenSource Name):arthurgregorio/library开源软件地址(OpenSource Url):https://github.com/arthurgregorio/library开源编程语言(OpenSource Language):Java 55.7%开源软件介绍(OpenSource Introduction):LibraryA simple demo application to show how to work with the default technologies of JavaEE version 8 (or higher). This conceptual architecture makes use of the following technologies:
It's not much say that if you want a production ready architecture, this is the project you are looking for. Create the databaseBefore the configuration step, create the database to used by the application: -- the user
CREATE USER sa_library WITH
LOGIN
NOSUPERUSER
INHERIT
NOCREATEDB
NOCREATEROLE
NOREPLICATION
ENCRYPTED PASSWORD 'sa_library';
-- the database
CREATE DATABASE library
WITH
OWNER = sa_library
ENCODING = 'UTF8'
LC_COLLATE = 'en_US.utf8'
LC_CTYPE = 'en_US.utf8'
TABLESPACE = pg_default
CONNECTION LIMIT = -1; The tables and the initial data (default user, group and authorizations) should 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 must create the schemes manually on PgAdmin or other similar software: CREATE SCHEMA configuration AUTHORIZATION sa_library;
CREATE SCHEMA registration AUTHORIZATION sa_library; Configure the applicationThe application provides three profiles to build and configure the application:
Every profile has his own configurations, it means that you can have separated environments and to activate them you just need to build the application again. Below we will configure the RELEASE profile and build a production artifact: <profile>
<id>release</id>
<properties>
<application.version>${project.version}-RELEASE</application.version>
<application.base-url>https://localhost:8443/</application.base-url>
<skip.tests>false</skip.tests>
<project.stage>Production</project.stage>
<mail.host>my-mail-host</mail.host>
<mail.port>587</mail.port>
<mail.debug>false</mail.debug>
<mail.from-address>noreply@your-domain.com</mail.from-address>
<mail.username>my@account.com</mail.username>
<mail.password>secret</mail.password>
<database.host>localhost</database.host>
<database.port>5432</database.port>
<database.name>library</database.name>
<database.username>sa_library</database.username>
<database.password>sa_library</database.password>
<orm.show_sql>false</orm.show_sql>
<orm.ddl_auto>none</orm.ddl_auto>
<ws.base-url>https://my-webservice-server.com</ws.base-url>
<ws.username>admin</ws.username>
<ws.password>admin</ws.password>
<ws.client-name>admin</ws.client-name>
<ldap.enabled>false</ldap.enabled>
<ldap.url>ldap://localhost</ldap.url>
<ldap.baseDn>OU=Users,DC=arthurgregorio,DC=eti,DC=br</ldap.baseDn>
<ldap.user>CN=bind-user,OU=Applications,DC=arthurgregorio,DC=eti,DC=br</ldap.user>
<ldap.password>my-bind-password</ldap.password>
</properties>
</profile> As you can see, just fill the properties with your configurations and build with the command below: mvnw clean package -Prelease
After the build process, a folder called To do that, just use: java -jar target/library-x.x.x-RELEASE-thorntail.jar If you have Java JDK installed, the application will start and should be available on
Running inside the IDEWe use maven to build the application and almost all the IDE on the market have a feature to import maven projects. By that, just import the project and you are ready to go! ContactIf you have any problem or want to contact me, send me an e-mail at: contato@arthurgregorio.eti.br |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论