Skip to content

dilbertside/spring-mvc-start-archetype-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prerequisites

Project Lombok

This project uses Project Lombok https://projectlombok.org/ to reduce bloated class property accessors

To benefit in your IDE the Lombok project

Eclipse install

https://projectlombok.org/setup/eclipse

IntelliJ install

IDEA https://projectlombok.org/setup/intellij

Build

Docker

Prerequisites: Docker must be installed

docker run -it --rm -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven diside/spring-mvc-start-archetype-docker:5.1.11 mvn clean package

locally

Prerequisites: Java and Apache Maven must be installed.

mvn clean package -Ph2

with default dev profile activated and H2 type DB

Unit Test

Docker

Prerequisites: Docker must be installed

docker run -it --rm -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven diside/spring-mvc-start-archetype-docker:5.1.11 mvn clean test

locally

Prerequisites: Java and Apache Maven must be installed.

mvn clean test

Run

Web app server

Drop the war built in any Web application container

Example

copy war in webapps directory and start

cd apache-tomcat-9.0.14
bin/startup.sh && tail -n80 -f logs/catalina.out

Docker container

Spotify docker builder

mvn clean install -Pdocker,dev,h2
docker run -it --rm -p 8080:8080 diside/webapp:latest

browse to http://localhost:8080/webapp/

Change environment profile "dev", database type profile "h2" as required and eventually "diside/webapp:1.0.0-dev" if default values were changed

JIB

It uses Google jib-maven-plugin which does not require to have docker installed on the build machine

mvn install -Pjib,dev,h2

or with a maven container

docker run -it --rm -v "$(pwd)":/usr/src/mymaven -v /var/run/docker.sock:/var/run/docker.sock -w /usr/src/mymaven diside/spring-mvc-start-archetype-docker:latest sh -c "mvn install -Pjib"