Skip to content

denisecase/Zoo04Lab

Repository files navigation

Zoo04Lab

Welcome to our Zoo!

Known Vulnerabilities Codacy Badge

Check Code with Static Analysis Tools

  • Snyk monitors our code for vulnerabilities in the packages we include.
  • Codacy checks our code for common 'code smells' and recommends improvements.
  • Click the badges to learn more.

API

Test Coverage

Test coverage report is hosted from a separate repo.

  • Create a new test reporting repo in the cloud. Settings / GitHub Pages / set to publish.
  • Clone this reporting repo down to your machine.
  • Generate the report from this project repo on your machine using the commands below.
  • Manually copy all files in the project target/site/jacoco folder into the root directory of this new reporting repo.
  • Git add & commit, then git push the files up to the cloud reporting repo.

Regenerate results periodically.

Open Powershell Here as Admininstrator in your root project folder (the one with pom.xml):

  • Prepare test results with mvn clean jacoco:prepare-agent install
  • Prepare coverage site with mvn jacoco:report
  • This builds target/site/jacoco which is then copied to the hosted repo above.

Run in Netbeans

  • Open the project
  • Make sure you're compiling with Java 17 or better

To run the console app, in Netbeans project view:

  • Right-click on App, click Run File

To run the web app, in Netbeans project view:

When done, remember to click the red icon to stop the currently running build. Use CTRL ALT DEL / Task Manager to view (& kill) any extra Netbeans processes.

Compile & Run with Java 17

Netbeans

  • Open project in Netbeans.
  • Right-click project / Properties / Build / Compile / JDK Version / select JDK 17.
  • Right-click project / Clean and build
  • Right-click project / Run

Powershell

java -version
mvn clean package spring-boot:repackage
java -jar target/Zoo04Lab-1.0-SNAPSHOT

Prepare the App for Heroku

  • Add Procfile
  • Add system.properties
  • Configure pom.xml

Deploy with Heroku

  • Heroku / New / Create new app - give it a name.
  • Click on app / Settings / Buildpacks / Add Buildpack / Java
  • Click on app / Settings / Deploy / GitHub / select repo / enable automatic deploys from main
  • Click on app / Settings / Deploy / Deploy branch (main) to deploy
  • Click on app / Settings / Overview / click on build logs to see progress, view errors

References

  1. Heroku - Customizing the JDK

Related GitHub Projects