Requires JDK version 19 - any distribution works.
Dynamic links for downloading files:
https://github.com/cloudsoft/hello-world-spring-boot/releases/latest/download/hello-world.jar https://github.com/cloudsoft/hello-world-spring-boot/releases/latest/download/creation-script-mariadb.sql
To build run:
mvn # with default goals
# or
mvn clean install
To run locally:
java -jar target/hello-world.jar
To run on a VM or Docker container, without a database:
nohup java -jar target/hello-world.jar --spring.profiles.active=local >> server.log 2>&1 &
To run on a VM or Docker container, with a remote database:
nohup java -jar target/hello-world.jar --spring.profiles.active=remote --server.port=XXXX --DB_IP=X.X.X.X --DB_PORT=XXXX --DB_USER=brooklyn --DB_PASS=br00k11n >> server.log 2>&1 &
If not present:
spring.profiles.active
defaults tolocal
(thus allDB_*
properties will be ignored)server.port
defaults to8080
DB_IP
defaults tolocalhost
(requires a MariaDB containter running on your Docker Runtime, built with the contents if themariadb-docker
directory)DB_PORT
defaults to3306
DB_USER
defaults tobrooklyn
DB_PASS
defaults tobr00k11n
NOTE: If you want to use different values for DB_USER
and DB_PASS
modify the creation-script-mariadb.sql
too before running it.
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080
sudo iptables -t nat -vnL
- Make DB configurable (use profiles to separate dependencies for each database type, currently we support H2 and MariaDB)
- {Your Proposal here} (Please contribute!)