A starter skeleton for Spring MVC
- Basic spring mvc web initialization without Spring data
- Logging with slf4j
- Common sense CSS JS libs from CDN. Typeform for feedback.
- debug cookie can be set by query param debug=true
- Authorization of controller actions via @Authable annotation
- Heroku-ready with Procfile, deploy plugin and or git push heroku master
- If you want to suggest changes, then fork and send a pull request. Or just add an issue.
- If you want to get started with your Spring MVC app using this skeleton, then DO NOT git clone. Instead perform git archive as suggested in http://stackoverflow.com/questions/160608/do-a-git-export-like-svn-export
- Ensure you have Java 1.8 and Maven 3.2.3 installed.
mvn clean install -Uin the app dir.- If you are planning to use Heroku, then download the Heroku toolbelt.
- Deploy.
- If you are using Heroku for other stages, such as prod, use their local tool by running –
heroku local web. java $JAVA_OPTS -jar target/dependency/jetty-runner.jar --port $PORT target/*.warfrom the app dir. This is whatheroku localwould do too.- Another way is to mvn tomcat7:run. This can be done from IntelliJ CE from the Plugins section of the 'Maven projects' pane.
- 4.1 and 4.2 will host the app on localhost:5000, whereas tomcat7 will host on localhost:8080, by default. Confirm that a simple HTML page is displayed and has a title tag in head with Company.com as a value.
git initgit add .The default.gitignorewill take care of some common default files.git commit -m "initial commit"- If you wish to set up a github or bitbucket repo, go to their respective web consoles and create a repo. It will give you a
.gitURL such ashttps://github.com/dahotre/SpringMVCStarter.git git remote add origin URL_FROM_ABOVE.gitgit push -u origin master
heroku create- Edit your
pom.xmlto add the generated (or custom) app name in the<profile>section. I.e., replaceimmense-plateau-6256with your newly generated app name. - Deploy
- First way to deploy to heroku is by using a git remote.
git push heroku master. This will push your local code as well as execute a maven compile and deploy the generated war. - Second way : assuming that you had performed a
mvn clean installormvn packagelocally, you will have a*.warfile ready to be deployed. Using the included heroku maven plugin, executemvn heroku:deploy-war -P test. - If either of the above 2 steps work out without issue, then
heroku opento see the website live in your default browser.