Skip to main content

Getting Started

Choose your path to start using the Java 25 Maven template based on your setup and preferences

Choose Your Scenario

๐Ÿ™

With GitHub Account

Recommended approach using GitHub's template feature for easy setup and version control.

Start Here
๐Ÿ“ฆ

Without GitHub Account

Download and set up the template manually, optionally initialize Git for version control.

Start Here
โšก

No Git Required

Quick start for evaluation or simple projects without version control setup.

Start Here
Recommended

Scenario 1: With GitHub Account

This is the easiest and most recommended approach if you have a GitHub account.

1

Use Template

Click the "Use this template" button on the GitHub repository page.

Use This Template
2

Configure Repository

Choose a repository name, set visibility (public/private), and optionally add a description.

3

Clone Your Repository

git clone https://github.com/user/repo.git
cd repo
4

Verify Setup

./mvnw test

This will download dependencies and run all tests to verify everything works.

๐ŸŽ‰ You're Ready to Code!

Your repository is set up with:

  • GitHub Actions CI/CD automatically enabled
  • All dependencies and configurations ready
  • Example code and tests to build upon
  • Version control history starts fresh

Scenario 2: Without GitHub Account

Download the template and set it up manually with optional Git initialization.

1

Download Template

Download the repository as a ZIP file from GitHub.

Download ZIP
2

Extract & Rename

unzip java-maven-template-main.zip
mv java-maven-template-main my-project-name
cd my-project-name
3

Initialize Git (Optional)

rm -rf .git && git init
git add . && git commit -m "Initial commit"
4

Verify Setup

./mvnw test

๐Ÿ”ง Optional: Connect to Remote Repository

If you want to push to a remote Git repository later:

git remote add origin https://your-repo-url.git
git branch -M main
git push -u origin main

๐Ÿ“ Update Project Information

Don't forget to update the project details in pom.xml:

  • groupId (org.acme โ†’ your.domain)
  • artifactId (lib โ†’ your-project-name)
  • name and description

Scenario 3: No Git Required

Quick evaluation or simple projects without version control. Perfect for learning or prototyping.

1

Download & Extract

Download and extract the template to your desired location.

Download ZIP
2

Remove Git Files

cd java-maven-template-main
rm -rf .git .github

Remove Git and GitHub Actions files since you won't need them.

3

Test Everything Works

./mvnw test

Maven wrapper will download everything needed and run tests.

4

Start Coding

Edit files in src/main/java and add tests in src/test/java.

๐Ÿ’ก What You Get

  • Full Java 25 development environment
  • Modern testing libraries and configuration
  • Code formatting and quality tools
  • Maven wrapper (no local Maven installation needed)
  • JShell integration for interactive development

Common Commands

Essential commands you'll use regardless of your setup scenario.

๐Ÿงช Testing

# Run unit tests only
./mvnw test

# Run integration tests only
./mvnw integration-test

# Run all tests (unit + integration)
./mvnw verify

โœจ Code Quality

# Format code automatically
./mvnw spotless:apply

# Check code formatting
./mvnw spotless:check

# Compile with format check
./mvnw compile

๐Ÿš Development

# Start JShell REPL
./mvnw jshell:run

# Create fat JAR
./mvnw package -Pshade

# Clean and rebuild
./mvnw clean compile

๐Ÿ“ฆ Package Management

# Update dependencies
./mvnw versions:display-dependency-updates

# Install to local repository
./mvnw install

# Skip tests during build
./mvnw package -DskipTests

Java Version Management with jenv

If you have multiple Java versions installed, use jenv to manage them for this project.

๐Ÿ”ง Setup jenv (First Time)

# Install jenv (macOS with Homebrew)
brew install jenv

# Add to shell profile
echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(jenv init -)"' >> ~/.zshrc

# Restart shell or source profile
source ~/.zshrc

โ˜• Configure Java 25

# Add Java 25 to jenv (adjust path as needed)
jenv add /path/to/java25

# List available versions
jenv versions

# Set Java 25 for this project
jenv local 25

# Verify version
java -version

๐Ÿ’ก Pro Tips

  • The template works with any Java 21+ version, but Java 25 is recommended for full feature support
  • jenv will create a .java-version file in your project directory
  • This ensures everyone on your team uses the same Java version
  • CI/CD pipeline is already configured with Oracle JDK 25

Need Help?

Check out the development guide for advanced workflows and best practices.