qbicsoftware / parent-poms

We keep all parent POMs under this single repository.
2 stars 1 forks source link
hacktoberfest

QBiC Parent POMs

This repository contains no code. It only contains the parent project object model (POM) files we use across all of our software.

Motivation

QBiC relies on Liferay and Vaadin for its front-end and including these dependencies every single time in every portlet is a time-consuming task. Using maven parent POM files enables organizations to define dependencies in a single POM file from which other modules (artifacts in maven lingo) can derive.

Structure

The hierarchy of the parent POMs reflects how QBiC structures its software:

parent-poms
    ├── cli
    │   └── pom.xml
    ├── portal
    │   ├── pom.xml
    │   └── portlet
    │       └── pom.xml
    └── pom.xml

For developers

Releasing a new version of the POMs

Since these parent POMs have dependencies between them, the cleanest way to manage releases is to use the same version for each of the POMs. Releasing the parent POMs is as simple as releasing other Maven artifacts. The first thing you need to do is to merge all changes into the master branch:

At this point, the HEAD of the master and development branches are identical. Update each of the parent POMs and the reference to their parents, as shown in this example:

File Before (snapshot version) After (release version)
pom.xml project/version = 1.2.0-SNAPSHOT project/version = 1.2.0
cli/pom.xml project/version = 1.2.0-SNAPSHOT
project/parent/version = 1.2.0-SNAPSHOT
project/version = 1.2.0
project/parent/version = 1.2.0
portal/pom.xml project/version = 1.2.0-SNAPSHOT
project/parent/version = 1.2.0-SNAPSHOT
project/version = 1.2.0
project/parent/version = 1.2.0
portal/portlet/pom.xml project/version = 1.2.0-SNAPSHOT
project/parent/version = 1.2.0-SNAPSHOT
project/version = 1.2.0
project/parent/version = 1.2.0

Here is a simplified version that you can run on your computer to install these POMs in your local Maven repository:

mvn install && mvn --file cli/pom.xml install && mvn --file portal/pom.xml install && mvn --file portal/portlet/pom.xml install

Once everything looks fine, stage, commit and push your changes:

Switch to the development branch (git checkout development) and bump the snapshot version:

File Before (snapshot version) After (release version)
pom.xml project/version = 1.2.0-SNAPSHOT project/version = 1.3.0-SNAPSHOT
cli/pom.xml project/version = 1.2.0-SNAPSHOT
project/parent/version = 1.2.0-SNAPSHOT
project/version = 1.3.0-SNAPSHOT
project/parent/version = 1.3.0-SNAPSHOT
portal/pom.xml project/version = 1.2.0-SNAPSHOT
project/parent/version = 1.2.0-SNAPSHOT
project/version = 1.3.0-SNAPSHOT
project/parent/version = 1.3.0-SNAPSHOT
portal/portlet/pom.xml project/version = 1.2.0-SNAPSHOT
project/parent/version = 1.2.0-SNAPSHOT
project/version = 1.3.0-SNAPSHOT
project/parent/version = 1.3.0-SNAPSHOT

And, again, stage, commit and push your changes (remember that you are on the development branch):