Skip to content

Parent repository defining plugins for building Java applications

Notifications You must be signed in to change notification settings

incodehq/incode-build

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

incode-build

This module defines a standard parent POM to use for various Incode applications and modules. Its primary purpose is to make it easy to use a set up maven mixins within child POMs; specifically to hold the required <pluginManagement> so that versions of plugins are locked down.

See below for details of the maven mixins so configured.

Note

This pom does not define any plugins for Apache Isis, so is independent of the release cycle of that framework.

Contents

This parent POM defines <properties> and <pluginManagement> for the plugins defined in the following maven mixins:

Module Version Description Mixin to add

cucumber reporting

0.0.2

Configures cucumber reporting plugin for BDD specs.

<mixin>
  <groupId>com.danhaywood.mavenmixin</groupId>
  <artifactId>cucumberreporting</artifactId>
</mixin>

datanucleus enhance

0.0.5

Configures datanucleus:enhance (for JDO entities of DN modules) for production and test code

<mixin>
  <groupId>com.danhaywood.mavenmixin</groupId>
  <artifactId>datanucleusenhance</artifactId>
</mixin>

docker

0.0.4

Configures docker to package images and upload to a docker registry (docker hub by default)

<mixin>
  <groupId>com.danhaywood.mavenmixin</groupId>
  <artifactId>docker</artifactId>
</mixin>

enforcer relaxed

0.0.2

Applies the maven enforcer plugin (but with relaxed dependency convergence)

<mixin>
  <groupId>com.danhaywood.mavenmixin</groupId>
  <artifactId>enforcerrelaxed</artifactId>
</mixin>

jetty console

0.0.2

Configure jetty-console plugin (to create a standalone version of a webapp)

<mixin>
  <groupId>com.danhaywood.mavenmixin</groupId>
  <artifactId>jettyconsole</artifactId>
</mixin>

jetty war

0.0.2

Package up a webapp as a WAR file, and to allow the webapp to be run using the jetty maven plugin

<mixin>
  <groupId>com.danhaywood.mavenmixin</groupId>
  <artifactId>jettywar</artifactId>
</mixin>

source and javadoc

0.0.2

Provides the ability to run source, javadoc and jxr plugins (packaged as JAR files or report using mvn site)

<mixin>
  <groupId>com.danhaywood.mavenmixin</groupId>
  <artifactId>sourceandjavadoc</artifactId>
</mixin>

standard

0.0.4

Defines the "standard" set of plugins (clean, compile, jar, install, site etc)

<mixin>
  <groupId>com.danhaywood.mavenmixin</groupId>
  <artifactId>standard</artifactId>
</mixin>

surefire

0.0.6

Run surefire plugin for unit, integration and/or (Cucumber) BDD specs.

<mixin>
  <groupId>com.danhaywood.mavenmixin</groupId>
  <artifactId>surefire</artifactId>
</mixin>

static analysis

0.0.2

Ability to run various static analysis plugins (checkstyle, pmd, findbugs, javancss, jdepend) as report mvn site

<mixin>
  <groupId>com.danhaywood.mavenmixin</groupId>
  <artifactId>staticanalysis</artifactId>
</mixin>

How to Configure

To configure:

  • inherit from this pom:

    <parent>
        <groupId>org.incode</groupId>
        <artifactId>incode-build</artifactId>
        <version>7</version>
    </parent>

    This has the effect of defining a number of <properties> (eg ${mavenmixin-surefire.version}) and also the setting up the <pluginManagement> of all of the plugins referenced by the above maven mixins.

  • for each maven mixin required in the consuming module, just add the corresponding <mixin> to:

<build>
    <plugins>
        <plugin>
            <groupId>com.github.odavid.maven.plugins</groupId>
            <artifactId>mixin-maven-plugin</artifactId>
            <version>0.1-alpha-39</version>
            <extensions>true</extensions>
            <configuration>
                <mixins>
                    ...                                         <!--(1)-->
                </mixins>
            </configuration>
        </plugin>
    </plugins>
</build>
  1. add in mixin reference here.

Tip

Just copy-n-paste from the fourth column of the above table,

For example, to enable the surefire mixin, just add:

<mixin>
    <groupId>com.danhaywood.mavenmixin</groupId>
    <artifactId>surefire</artifactId>
</mixin>

Change Log

for use with Apache Isis 2.0.0-Mx

  • 8 (merges in 2.6) - replaces existing repository definition (repo.incode.cloud) with repo.incode.work). Also adds profile for gcpappenginerepo-deploy

  • 7 - (merges in 2.5) replaces existing repository definitions (cloudbees, sonatype snapshot, apache snapshot) with repo.incode.cloud. Also adds profile for nexus-deploy.

  • 6 - (merges in 2.4), moves snapshot repository definitions into profiles

  • 5 - (merges in 2.1, 2.2, 2.3), bumps to surefire 0.0.6, standard 0.0.4, docker 0.0.4

  • 4 - (based on 2), updated for datanucleus 0.0.5, to include DN 5.1.5 (in preparation for Apache Isis v2.0)

for use with Apache Isis 1.x

  • 2.6 - replaces existing repository definition (repo.incode.cloud) with repo.incode.work). Also adds profile for gcpappenginerepo-deploy

  • 2.5 - replaces existing repository definitions (cloudbees, sonatype snapshot, apache snapshot) with repo.incode.cloud. Also adds profile for nexus-deploy.

  • 2.4 - moves snapshot repository definitions into profiles

  • 2.3 - maintenance release, bumps to docker 0.0.4

  • 2.2 - maintenance release, bumps to standard 0.0.4

  • 2.1 - maintenance release, bumps to surefire 0.0.6

  • 2 - adds in gmavenplus-plugin dependency, used by for docker-mavenmixin.

  • 1 - first release, adapted from incode-parent (v1.13.2.1), but removed all dependencies and reference to Apache Isis.

License

Copyright 2017~date Dan Haywood

Licensed under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.

Dependencies

This mixin module relies on the com.github.odavid.maven.plugins:mixin-maven-plugin, released under Apache License v2.0.

Maven deploy notes

The module is deployed using Sonatype’s OSS support (see user guide and this blog post).

The release.sh script automates the release process. It performs the following:

  • performs a sanity check (mvn clean install -o) that everything builds ok

  • bumps the pom.xml to a specified release version, and tag

  • performs a double check (mvn clean install -o) that everything still builds ok

  • releases the code using mvn clean deploy

  • bumps the pom.xml to a specified release version

For example:

sh release.sh 8 \
              9-SNAPSHOT \
              danhaywood \
              Pa$$w0rd \
              dan@haywood-associates.co.uk \
              "this is not really my passphrase"

where

  • $1 is the release version

  • $2 is the snapshot version

  • $3 is the nexus user account for https://oss.sonatype.org/ (ie to deploy)

  • $4 is the corresponding password

  • $5 is the email of the secret key (~/.gnupg/secring.gpg) to use for signing

  • $6 is the corresponding passphrase for that secret key.

Other ways of specifying the key and passphrase are available, see the pgp-maven-plugin's documentation).

If the script completes successfully, then push changes:

git push origin v2 && git push origin 8

If the script fails to complete, then identify the cause, perform a git reset --hard to start over and fix the issue before trying again. Note that in the dom’s `pom.xml the nexus-staging-maven-plugin has the autoReleaseAfterClose setting set to true (to automatically stage, close and the release the repo). You may want to set this to false if debugging an issue.

According to Sonatype’s guide, it takes about 10 minutes to sync, but up to 2 hours to update search.

About

Parent repository defining plugins for building Java applications

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages