Skip to content

serhiikartashov/heroku-simple-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

java-project-template

This is template for CI configurations

Build Status Quality Gate Status

Running App

Terminal:

  • sh target/bin/webapp

IDEA:

  • launch forest.detector.Launcher (entry point)
  • add mvn package | mvn clean package command into launcher
  • add to VM options -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager for logging tomcat server

heroku

https://devcenter.heroku.com/articles/heroku-cli-commands

  • create account on heroku.com
  • heroku login
  • heroku create java-project-template
  • heroku info
  • mvn clean heroku:deploy-war
  • heroku open
  • heroku logs
  • heroku logs -tn 20
  • heroku logs -tn 20 --source app
  • heroku logs -tn 20 -s app

NOTE: make sure git added new heroku remote repo

git remote -v
heroku  https://git.heroku.com/java-project-template.git (fetch)
heroku  https://git.heroku.com/java-project-template.git (push)
origin  https://github.com/searhiy/java-project-template.git (fetch)
origin  https://github.com/searhiy/java-project-template.git (push)

NOTE: heroku filter logs https://devcenter.heroku.com/articles/logging

NOTE: heroku postgresql https://elements.heroku.com/addons/heroku-postgresql https://devcenter.heroku.com/articles/heroku-postgresql

###NOTE: java servlet annotations https://www.codejava.net/java-ee/servlet/servlet-annotations-reference

  • @WebServlet annotation
  • @WebListener annotation
  • @WebFilter annotation
  • @WebInitParam annotation
  • @HandlesTypes annotation
  • @MultipartConfig annotation
  • @ServletSecurity, @HttpMethodConstraint and @HttpConstraint annotations

https://api.nasa.gov/ BwKaaRv4epDjcbXXiLdcURczJyUwTkNrSabQHeZ9 i.e. https://api.nasa.gov/planetary/apod?api_key=BwKaaRv4epDjcbXXiLdcURczJyUwTkNrSabQHeZ9

https://www.w3.org/TR/html-json-forms/

<form enctype='application/json'>
  <input name='name' value='Bender'>
  <select name='hind'>
    <option selected>Bitable</option>
    <option>Kickable</option>
  </select>
  <input type='checkbox' name='shiny' checked>
</form>

// produces
{
  "name":   "Bender"
, "hind":   "Bitable"
, "shiny":  true
}

https://www.w3schools.com/tags/att_form_action.asp https://www.codejava.net/java-ee/servlet/handling-html-form-data-with-java-servlet

https://stackoverflow.com/questions/3541077/design-patterns-web-based-applications/

Tokens generation

  • copy token from sonar website -> manual configuration for maven
  • heroku auth:token and set it in env variable HEROKU_API_KEY

NewRelic

https://docs.newrelic.com/docs/agents/java-agent/heroku/java-agent-heroku

  • heroku config:set NEW_RELIC_LICENSE_KEY="key"
  • heroku config:set NEW_RELIC_APP_NAME="java-project-template"

About

Java Web template project with CI configurations based on servlet annotations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published