Skip to content
/ example-jvm-maven Public template
generated from block/oss-project-template

Example to bootstrap new Java Kotlin Maven Projects

License

Notifications You must be signed in to change notification settings

block/example-jvm-maven

Repository files navigation

JVM Maven Example

This project kickstarts your work in a new JVM/Maven project. It should get you building as quickly as possible - with best practices and services baked in. It's designed for the Block Open Source Program, and may be adapted for other contexts.

Features

  • Multimodule Maven project structure with 2 built-in modules: api and impl.
  • Hermit managed environment (Java, Maven)
  • GitHub Actions for Continuous Integration:
    • Testing in both MacOS and Ubuntu environments
    • Every commit to main published as SNAPSHOT in Block Artifactory
    • Static Analysis (CodeQL)
    • License scanning (FOSSA)
    • Security Vulnerability detection for dependencies (FOSSA)
    • Automatic dependency upgrades (Renovate)
    • Release and Publishing to Maven Central

Usage

To build a project using this template as a base:

  1. Create a new repository.
image
  1. Select block/example-jvm-maven as the Repository template.
image

Preparing Your Project from This Template

There are a few steps you'll need to take from this quickstart template to get your project ready for action.

🗺️ Change the Maven Coordinates

This example has groupID of xyz.block and artifactIds of example-jvm-maven-*. You'll need to update all pom.xml files:

  • ./pom.xml
  • ./api/pom.xml
  • ./impl/pom.xml

...to reflect your desired artifactIds. Note that changing the groupId may render your project unable to publish into Maven Central; the account we use to publish is cleared for the xyz.block namespace. Block employees may assistance by opening an internal issue with the Open Source Program Office if they need to use a different groupId.

🔑 Get access to required GitHub Actions Secrets

The workflows on this project rely on GitHub Actions secrets, environment variables, to run the build. The Open Source Program Office team will, for security purposes, make these secrets available to your project. The variables in question are:

  • SONATYPE_USERNAME - A token tied to the Block OSS Sonatype account
  • SONATYPE_PASSWORD - Password for the above
  • GPG_SECRET_KEY - Key used for signing releases
  • GPG_SECRET_PASSPHRASE - Passphrase for above

Your repo will also need access to the Artifactory repo for snapshot releases.

Block employees may request access to these by opening an internal issue with the Open Source Program Office.

🚀 Get Building

Go get 'em. 🤘🏻🤘🏼🤘🏽🤘🏾🤘🏿

Instructions are in CONTRIBUTING.md.


README Template

This is the part you adapt for your project's audience.

This stub is meant to help you form a strong community around your work. It's yours to adapt, and may diverge from this initial structure. Just keep the files seeded in this repo, and the rest is yours to evolve!

Introduction

Orient users to the project here. This is a good place to start with an assumption that the user knows very little - so start with the Big Picture and show how this project fits into it.

Then maybe a dive into what this project does.

Diagrams and other visuals are helpful here. Perhaps code snippets showing usage.

Project leads should complete, alongside this README:

  • CODEOWNERS - set project lead(s)
  • CONTRIBUTING.md - Fill out how to: install prereqs, build, test, run, access CI, chat, discuss, file issues
  • Bug-report.md - Fill out Assignees add codeowners @names
  • config.yml - remove "(/add your discord channel..)" and replace the url with your Discord channel if applicable

The other files in this template repo may be used as-is:

Project Resources

Resource Description
CODEOWNERS Outlines the project lead(s)
CODE_OF_CONDUCT.md Expected behavior for project contributors, promoting a welcoming environment
CONTRIBUTING.md Developer guide to build, test, run, access CI, chat, discuss, file issues
GOVERNANCE.md Project governance
LICENSE Apache License, Version 2.0