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 HereWithout GitHub Account
Download and set up the template manually, optionally initialize Git for version control.
Start HereNo Git Required
Quick start for evaluation or simple projects without version control setup.
Start HereScenario 1: With GitHub Account
This is the easiest and most recommended approach if you have a GitHub account.
Use Template
Click the "Use this template" button on the GitHub repository page.
Use This TemplateConfigure Repository
Choose a repository name, set visibility (public/private), and optionally add a description.
Clone Your Repository
git clone https://github.com/user/repo.git
cd repo
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.
Extract & Rename
unzip java-maven-template-main.zip
mv java-maven-template-main my-project-name
cd my-project-name
Initialize Git (Optional)
rm -rf .git && git init
git add . && git commit -m "Initial commit"
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.
Remove Git Files
cd java-maven-template-main
rm -rf .git .github
Remove Git and GitHub Actions files since you won't need them.
Test Everything Works
./mvnw test
Maven wrapper will download everything needed and run tests.
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.