This templates helps you to create portable Java projects.
We recommend you to use Ubuntu to the correctly use of this templates.
In order to generate a Java project from one of this templates you need to install the following softwares:
- Git - Version Control System
- SDKMAN - Software Development Kit Manager
- Docker - Container provider
- Tsuru - Platform as a Service (Paas)
Open your terminal and type the command below:
sdk install java
sdk install maven
sdk install gradle
sdk install lazybones
Lazybones allows you to create a new project structure for any framework or library for which the tool has a template.
If you want more information about lazybones project check it out here and here
This project use containers provided by Docker.
In order to create a container for Pgadmin4, you need to create a folder in your host directory as Pgadmin4 volume folder.
Create in your home directory (/$HOME/), creates a folder called pgadmin4 and, in terminal, add permission running the following command:
mkdir -p $HOME/pgadmin4
sudo chmod 777 /$HOME/pgadmin4
Note: If you are behind a HTTP or HTTPS proxy server, you will need to create a file called gradle.properties in the /$HOME/.gradle directory, add the file the following properties:
org.gradle.jvmargs=-Xmx1536m
systemProp.http.proxyHost=proxy.campos.rj.gov.br
systemProp.http.proxyPort=80
systemProp.http.nonProxyHosts=localhost
systemProp.http.auth.ntlm.domain=domain
systemProp.https.proxyHost=proxy.campos.rj.gov.br
systemProp.https.proxyPort=80
systemProp.https.nonProxyHosts=localhost
systemProp.https.auth.ntlm.domain=domain
Open the terminal and execute the commands below:
mkdir -p $HOME/Projects/Java
Open the terminal and execute the commands below:
cd $HOME/Projects/Java
git clone git@gitlab.campos.rj.gov.br:cubo/java-templates.git
Open the terminal and execute the commands below:
cd $HOME/Projects/Java/java-templates
./gradlew installAllTemplates
To see if the templates were installed:
lazybones list --cache
If you want to use Microsoft Visual Studio Code (VS Code) follow the instructions bellow to configure the Editor.
Create a file called settings.json and add the following properties:
{
"explorer.confirmDelete": false,
"editor.tabSize": 2,
"editor.tabCompletion": true,
"files.autoSave": "afterDelay",
"files.autoSaveDelay": 5000,
"editor.renderWhitespace": "all"
}
You could also use the following plugins:
- Debugger for Java
- Java Extension Pack
- Language Support for Java(TM) by Red Hat
- Git Project Manager
- gitLens - Git supercharged
- Docker
- markdownlint
We have 2 (two) templates that you can choose and create your project from them: spring-boot-web and spring-boot-web-tsuru.
spring-boot-web template will generate a Spring boot Java project configured with:
- Gradle
- Spring Boot
- Spring Data JPA
- Logback
- Docker
- FlywayDB
- PostgreSQL connection database
- Guava
- Spring Actuator
- Swagger
To create a spring-boot-web project follow the instructions of this link.