diff --git a/README.md b/README.md index 69555e0..3a99f0c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # java-common -Reusable build configuration for BorderTech open source projects. - ## Status [![Build Status](https://travis-ci.com/BorderTech/java-common.svg?branch=master)](https://travis-ci.com/BorderTech/java-common) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=bordertech-java-common&metric=alert_status)](https://sonarcloud.io/dashboard?id=bordertech-java-common) @@ -9,9 +7,32 @@ Reusable build configuration for BorderTech open source projects. [![Codacy Badge](https://api.codacy.com/project/badge/Grade/c7a2226acd574943af9ae966c54b05e6)](https://app.codacy.com/app/BorderTech/java-common?utm_source=github.com&utm_medium=referral&utm_content=BorderTech/java-common&utm_campaign=Badge_Grade_Dashboard) [![Maven Central](https://img.shields.io/maven-central/v/com.github.bordertech.common/bordertech-parent.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.bordertech.common%22%20AND%20a:%22bordertech-parent%22) -## qa-parent +## Content + +- [What is java-common](#what-is-java-common) +- [Why use java-common](#why-use-java-common) +- [Getting started](#getting-started) +- [Features](#features) +- [Configuration](#configuration) +- [Contributing](#contributing) + +## What is java-common + +Reusable build configuration and parent pom modules for BorderTech open source projects. + +## Why use java-common + +- Simplifies the steps to release your project to Maven Central +- Enforce quality assurance and security checks on your project code + +## Getting started -BorderTech java projects should generally use this as their parent POM. +java-common provides two parent pom modules: + +- [bordertech-parent](https://github.com/BorderTech/java-common/blob/master/pom.xml) is the top level pom that configures [maven release plugin](https://maven.apache.org/maven-release/maven-release-plugin/) +- [qa-parent](https://github.com/BorderTech/java-common/blob/master/qa-parent/pom.xml) provides quality assurance and security checks + +Projects should generally use qa-parent as their parent POM: ``` xml @@ -25,18 +46,48 @@ BorderTech java projects should generally use this as their parent POM. ``` -It runs quality assurance checks on your java code using tools such as [Checkstyle](https://maven.apache.org/plugins/maven-checkstyle-plugin/checkstyle-mojo.html), [PMD](https://maven.apache.org/plugins/maven-pmd-plugin/) and [Spotbugs](https://spotbugs.github.io/spotbugs-maven-plugin/spotbugs-mojo.html). - -By default qa checks do not run, you must enable them on a per-module basis or parent pom like so: +By default qa checks do not run, you must enable them on a per-module basis or in your project parent pom: ``` xml - - + false - + ``` -Refer to qa-parent's [pom.xml](https://github.com/BorderTech/java-common/blob/master/qa-parent/pom.xml) for other project properties. +### Releasing + +If using maven release ensure the necessary POM sections are overriden - these are marked in the bordertech-parent pom, for example: + +``` xml + +https://github.com/bordertech/java-common/ +``` + +Once you have configured your project and environment you can release to Maven Central. + +The golden rule for releasing is ALWAYS do the release on a separate branch (it makes [backing out](https://github.com/BorderTech/java-common/wiki/Releasing#dealing-with-failure) much easier when problems arise). + +Full documentation is available in the wiki under [Releasing](https://github.com/BorderTech/java-common/wiki/Releasing). + +## Features + +### bordertech-parent + +This is the top-level pom.xml file. + +It configures the [maven release plugin](https://maven.apache.org/maven-release/maven-release-plugin/index.html) for projects to release to Maven Central. + +_Note that java projects should generally not consume this directly but instead should use qa-parent as a parent POM instead._ + +### qa-parent + +The qa-parent runs quality assurance checks on your java code using tools such as: + +- the [Checkstyle plugin](https://maven.apache.org/plugins/maven-checkstyle-plugin) to check the code style used by the developers +- the [PMD plugin](https://maven.apache.org/plugins/maven-pmd-plugin) for source code analysis +- the [Spotbugs plugin](https://spotbugs.github.io/spotbugs-maven-plugin) that looks for bugs in Java programs using bug patterns The qa-parent also runs: @@ -46,17 +97,19 @@ The qa-parent also runs: - the [JaCoCo plugin](https://www.eclemma.org/jacoco/trunk/doc/maven.html) for code coverage reports - the [Surefire plugin](https://maven.apache.org/surefire/maven-surefire-plugin) for running unit tests -The qa-parent inherits all of the release functionality from bordertech-parent, discussed below. +The qa-parent inherits all of the release functionality from bordertech-parent. -## bordertech-parent +### build-tools -This is the top-level pom.xml file. +This is primarily a shared resources module used by qa-parent and potentially other BorderTech maven modules. -It configures the maven release plugin for open source BorderTech projects to release to Maven Central. +## Configuration -_Note that java projects should generally not consume this directly but instead should use qa-parent as a parent POM instead._ +### bordertech-parent config -Projects using this must ensure the necessary POM sections are overriden - these are marked in the bordertech-parent pom, for example: +Refer to bordertech-parent's [pom.xml](https://github.com/BorderTech/java-common/blob/master/pom.xml) for all project properties. + +Projects must ensure the necessary POM sections are overriden - these are marked in the bordertech-parent pom, for example: ``` xml @@ -313,3 +356,7 @@ If your project has multiple modules and you want to provide the same override/e ``` + +## Contributing + +Refer to these guidelines for [Workflow](https://github.com/BorderTech/java-common/wiki/Workflow) and [Releasing](https://github.com/BorderTech/java-common/wiki/Releasing).