Simple hello world application template
~/helloworld$ java -jar target/helloworld-0.0.1-SNAPSHOT-jar-with-dependencies.jar -h
helloworld
Version: 0.0.1
usage: helloworld
-h Display this help text
-v Verbose mode
- Follow the instructions to create a repository based on this GitHub template.
- Change references to any urls, authors, and emails throughout the project. HINT: Don't forget the license.
- Update the package name througout the project. HINT: Don't forget the folder structure.
- Update the project name and references throughout the project including the pom.xml, this README, the Dockerfile, and source.
- Update the version number appropriately.
- Code away!
- Docker - Simple development environment setup or
- A Java development environment like OpenJDK and Apache Maven
Apache Maven is the build tool of choice. Simply issue mvn install package to install dependencies and build the jar.
Use mvn clean install compile verify test package site to clean up existing targets, install dependencies, verify, run unit tests, build a jar, and create the documentation and reports.
Issue a java -jar target/helloworld-<VERSION>-SNAPSHOT-jar-with-dependencies.jar to run the target directly.
- Build the image by running
docker build -t helloworldtemplate .in a terminal - Then run the container based on the image with
docker run -it --rm -v $PWD:/helloworld helloworldtemplateon Linux or an absolute path in Windows likedocker run -it --rm -v /c/git/java-hello-world-template:/helloworld helloworldtemplate - Use VSCode or your IDE of choice to edit your code locally. HINT: With VSCode run
code .from the terminal when in the folder to easily open it - Build and run the code as you would locally from the Docker container Bash prompt
JUnit is used as the Test Framework. To execute unit tests run mvn test.
To skip tests, add -Dmaven.test.skip=true as an argument to your Maven command.
- All code (classes, files, global variables, members, and methods) must be thoroughly documented using JavaDoc accepted format. HINT: Use
mvn site - All existing unit tests must pass. HINT: Use
mvn test - New unit tests are encouraged!
- README, help text, makefile, and other artifacts must be up to date.
- Program version number should be incremented. HINT: In the pom.xml and global variables
- Use proper git ettiquete with frequent commits and good commit messages.
- All code must be formatted properly and verified with checkstyle. HINT: Use
mvn verify - Binary files and other metadata shall not be committed. HINT: Update the .gitignore, if necessary
- No warnings or errors shall be produced by Maven with
mvn verify test site compileoptions.