Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eis/spring-mvc-example

Hello World with Spring MVC, coupled with VM & tests. A simple startup example.
https://github.com/eis/spring-mvc-example

java11 java8 spring-mvc

Last synced: 3 months ago
JSON representation

Hello World with Spring MVC, coupled with VM & tests. A simple startup example.

Awesome Lists containing this project

README

        

spring-mvc-example
==================

Hello World with Spring MVC, using Spring 5 xml configs, having Tomcat deployment
preconfigured. This is meant to be simplest-as-possible but with MVC
configuration and Maven POM ready to be deployed.

In addition to being simple, it does have
- HTML GET interface ([/](http://localhost:8080/spring-mvc-example)) and JSON-using REST interface ([/add](http://localhost:8080/spring-mvc-example/add))
- "runme" build and deploy script
- Jetty-based deployment test
- integration tests
- robot acceptance test
- GitHub Actions build
- CodeCov integration
- Swagger documentation
- Vagrantfile with Tomcat setup
- Dockerfile with Tomcat setup
- Tomcat setup scripts for Ubuntu environment

Infra setup + build & run (Docker)
----------------------------------

```
docker build . -t spring-mvc-example
docker run -p 8080:8080 spring-mvc-example
```

Redeploy in Docker container
----------------------------
```
docker exec CONTAINERID mvn clean package
docker exec CONTAINERID mv target/spring-mvc-example.war /usr/local/tomcat/webapps/
```

Infra setup (VM)
----------------

```
vagrant up
```

Infra setup (Ubuntu host)
-------------------------

```
./ubuntu-deps.sh
./add-tomcat-admin.sh
systemctl restart tomcat8
```

Build & run the app in VM
-------------------------

First time (full cycle):
```
mvn -s settings-vm.xml tomcat7:deploy
```
Deploy again, only deploy:
```
mvn -s settings-vm.xml tomcat7:redeploy-only
```

See the app yourself
--------------------

[http://localhost:8080/spring-mvc-example](http://localhost:8080/spring-mvc-example)