Welcome to maven-java-template, a flexible starting point for creating Maven-based Java projects. This template is designed to streamline the setup process for new Java projects, incorporating essential plugins and dependencies to get you up and running quickly.
- Dependencies: Preconfigured with Checker Framework, Mockito, and JUnit.
- Plugins: Includes Checkstyle, Source, Javadoc, GPG, Central Publishing, JaCoCo, Checker Framework, Jar, and Assembly.
- Branching Strategy: Four branches (
main
,beta
,alpha
, anddev
) to manage different stages of development and release. - CI/CD Pipelines: Automated checks for code style, build, testing, static code analysis, and publishing to Maven Central.
git clone https://github.com/lengors/maven-java-template.git
cd maven-java-template
Ensure you have Maven and JDK installed. Run:
./mvnw clean install
./mvnw clean test
This template is designed to be as customizable as you need. You can modify dependencies, plugins, or other configurations to suit your specific project needs.
- GPG Signing: Ensure GPG is set up in your environment with the necessary private key. The passphrase can be set via the
MAVEN_GPG_PASSPHRASE
environment variable or directly in thepom.xml
. - Maven Central Publishing: Set your Maven Central credentials in your
settings.xml
file or via environment variablesMAVEN_CENTRAL_USERNAME
andMAVEN_CENTRAL_PASSWORD
. - Publishing Releases: The publishing action relies on semantic-release and semantic-release-action. The
.releaserc.yml
file defines the release pipeline and automates versioning based on semantic versioning. - Jar and Assembly Plugins: The
jar
andassembly
plugins are configured in separate Maven profiles (jar
andassemble
, respectively). These profiles are intended for building final applications and should be activated only if you’re creating a standalone application. For libraries, these profiles can be removed as they aren’t necessary.
For detailed guides and additional information, please refer to our GitHub Wiki.
If you wish to check the detailed API documentation, visit the Javadoc page.
Contributions are welcome! Please refer to our Contribution Guidelines for more information on how to get involved.
This project is licensed under The Unlicense, which places it in the public domain.