Getting started
This page allows you to know how to start developing an application with Ontimize Boot in a simple way. This project includes an HSQLDB database already prepared to start the application. It can be replaced.
Prerequisites
- Java JDK 11
- Maven
- Any IDE that supports Spring Boot (Eclipse, IntelliJ…)
- Git (Optional)
Create application from archetype
Open a console and type the next command:
mvn archetype:generate -DgroupId=YOUR_GROUP_ID -DartifactId=YOUR_ARTIFACT_ID -Dversion=YOUR_VERSION -Dpackage=YOUR.GROUPID.ARTIFACTID -DarchetypeGroupId=com.ontimize -DarchetypeArtifactId=ontimize-boot-backend-archetype -DarchetypeVersion=99.9.9-SNAPSHOT -DinteractiveMode=false
Command explanation
Argument | Meaning |
---|---|
mvn | Maven CLI |
archetype:generate | Use the Maven Archetype Plugin for create a new project from an archetype |
-DgroupId=YOUR_GROUP_ID | Your project groupId |
-DartifactId=YOUR_ARTIFACT_ID | Your project artifactId |
-Dversion=YOUR_VERSION | Your project version |
-Dpackage=YOUR.GROUPID.ARTIFACTID | Sets the package on which the project will be based (e.g.: In our examples, this will be com.ontimize.projectwiki) |
-DarchetypeGroupId=com.ontimize | groupId of the Ontimize Boot archetype |
-DarchetypeArtifactId=ontimize-boot-backend-archetype | artifactId of the Ontimize Boot archetype |
-DarchetypeVersion=99.9.9-SNAPSHOT | version of the Ontimize Boot archetype. This SNAPSHOT indicates the latest version |
-DinteractiveMode=false | Forced to skip interactive mode and use the paramaters in the command |
Start the project
-
app
-
api
-
src
-
main
-
java
-
api
-
core
-
service
- IUserService.java
-
service
-
core
-
api
-
java
-
main
- pom.xml
-
src
-
boot
-
src
-
main
-
java
-
boot
-
core
- ServerApplication.java
-
core
-
boot
-
resources
- application.yml
-
java
-
main
- pom.xml
-
src
-
model
-
src
-
main
-
db
- templateDB.lck
- templateDB.log
- templateDB.properties
- templateDB.script
- templateDB.txt
-
java
-
model
-
core
-
dao
- UserDao.java
- UserRoleDao.java
-
service
- UserService.java
-
dao
-
core
-
model
-
resources
-
dao
- placeholders.properties
- RoleDao.xml
- RoleServerPermissionDao.xml
- ServerPermissionDao.xml
- UserDao.xml
- UserRoleDao.xml
-
dao
-
db
-
main
- pom.xml
-
src
-
ws
-
src
-
main
-
java
-
ws
-
core
-
rest
- MainRestController.java
- TestRestController.java
- UserRestController.java
-
rest
-
core
-
ws
-
java
-
main
- pom.xml
-
src
- pom.xml
- README.md
-
api
To start the project, it is necessary to start both the database and the server.
The first thing to do is to execute the mvn install
command inside the project’s root folder
$ cd app
/app$ mvn install
Start the database
-
app
-
api
-
src
-
main
-
java
-
api
-
core
-
service
- IUserService.java
-
service
-
core
-
api
-
java
-
main
- pom.xml
-
src
-
boot
-
src
-
main
-
java
-
boot
-
core
- ServerApplication.java
-
core
-
boot
-
resources
- application.yml
-
java
-
main
- pom.xml
-
src
-
model
-
src
-
main
-
db
- templateDB.lck
- templateDB.log
- templateDB.properties
- templateDB.script
- templateDB.txt
-
java
-
model
-
core
-
dao
- UserDao.java
- UserRoleDao.java
-
service
- UserService.java
-
dao
-
core
-
model
-
resources
-
dao
- placeholders.properties
- RoleDao.xml
- RoleServerPermissionDao.xml
- ServerPermissionDao.xml
- UserDao.xml
- UserRoleDao.xml
-
dao
-
db
-
main
- pom.xml
-
src
-
ws
-
src
-
main
-
java
-
ws
-
core
-
rest
- MainRestController.java
- TestRestController.java
- UserRestController.java
-
rest
-
core
-
ws
-
java
-
main
- pom.xml
-
src
- pom.xml
- README.md
-
api
Next, we navigate to the model
folder to start the HSQLDB database
/app$ cd model
/app/model$ mvn exec:java -Prun_database
Start the server
-
app
-
api
-
src
-
main
-
java
-
api
-
core
-
service
- IUserService.java
-
service
-
core
-
api
-
java
-
main
- pom.xml
-
src
-
boot
-
src
-
main
-
java
-
boot
-
core
- ServerApplication.java
-
core
-
boot
-
resources
- application.yml
-
java
-
main
- pom.xml
-
src
-
model
-
src
-
main
-
db
- templateDB.lck
- templateDB.log
- templateDB.properties
- templateDB.script
- templateDB.txt
-
java
-
model
-
core
-
dao
- UserDao.java
- UserRoleDao.java
-
service
- UserService.java
-
dao
-
core
-
model
-
resources
-
dao
- placeholders.properties
- RoleDao.xml
- RoleServerPermissionDao.xml
- ServerPermissionDao.xml
- UserDao.xml
- UserRoleDao.xml
-
dao
-
db
-
main
- pom.xml
-
src
-
ws
-
src
-
main
-
java
-
ws
-
core
-
rest
- MainRestController.java
- TestRestController.java
- UserRestController.java
-
rest
-
core
-
ws
-
java
-
main
- pom.xml
-
src
- pom.xml
- README.md
-
api
To start the server, open a new console in the root folder of the project, navigate to boot
folder and type the following command
/app$ cd boot
/app/boot$ mvn spring-boot:run
Test the application
You can check if the application is working by making a request, for example, to the following address:
http://localhost:33333/users/user?columns=USER_
Through applications such as Postman or from the browser
In both cases, the access must be done with a user and password example:
User: demo
Password: demouser