code-quality-maven-plugin

Add quality gate to your Maven project

License

License

MIT
Categories

Categories

Maven Build Tools
GroupId

GroupId

com.exsoinn
ArtifactId

ArtifactId

code-quality-maven-plugin
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

code-quality-maven-plugin
Add quality gate to your Maven project
Project URL

Project URL

http://github.com/joquijada/code-quality-maven-plugin
Source Code Management

Source Code Management

https://github.com/joquijada/code-quality-maven-plugin

Download code-quality-maven-plugin

How to add to project

<plugin>
    <groupId>com.exsoinn</groupId>
    <artifactId>code-quality-maven-plugin</artifactId>
    <version>1.2.0</version>
</plugin>

Dependencies

compile (5)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 2.0
org.codehaus.plexus : plexus-utils jar 3.0.8
org.twdata.maven : mojo-executor jar 2.3.0
org.apache.maven : maven-core jar 3.6.0
org.codehaus.plexus : plexus-component-annotations jar 1.7.1

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.2

test (3)

Group / Artifact Type Version
junit : junit jar 4.8.2
org.mockito : mockito-all jar 1.9.5
org.junit.jupiter : junit-jupiter-api jar RELEASE

Project Modules

There are no modules declared in this project.

code-quality-maven-plugin

This project is a Maven extension plugin that can be used in you project to incorporate, declaratively (I.e. via Maven plugin configurations) other plugins that assist in ascertaining the quality of the code associated with that project.

Build Status Quality Gate Status

Introduction

Inspiration for this project came from the Maven Code Quality Pom.

This plugin conveniently wraps all of the quality reporting modules/plugins in Maven Code Quality Pom, dynamically adding and configuring each of those plugin and modules to your project. In your project all you need to do is add a few lines of XML in the project's pom.xml. You get the full power and benefits of Maven Code Quality Pom, without having to redo the work of adding manually adding and configuring each individually. Below is a sample configuration:

<build>
  ...
  <plugins>
    ...
    <plugin>
      <groupId>com.exsoinn</groupId>
      <artifactId>code-quality-maven-plugin</artifactId>
      <!-- Very important, must enable Maven extensions-->
      <extensions>true</extensions>
      <configuration>
        <scmUrl>scm:git:https://path-to-git-project</scmUrl>
        <siteUpload>true</siteUpload>
        <sitePath>path-into-which-to-deploy-the-site</sitePath>
        <siteMerge>false</siteMerge>
        <packageNames>comma-separate-list-of-class-package-names</packageNames>
      </configuration>
    </plugin>
    ...
  </plugins>
  ...
</build>

How It Works

We make use of Maven extension mechanism. Class org.apache.maven.AbstractMavenLifecycleParticipant has been extended to modify the Maven project model after its been read, but before a plan has been put together and executed.

Install

Include the following in your project's pom.xml:

<dependencies>
  ...
  <dependency>
    <groupId>com.exsoinn</groupId>
    <artifactId>code-quality-maven-plugin</artifactId>
    <version>1.0.0</version>
    <type>maven-plugin</type>
  </dependency>
  ..
</dependencies>

Configuration

This section describes the parameters you can specify the in <configuration/> section of the plugin. Unless otherwise noted, each of the parameters below themselves are XML tags, for example <uploadSite>true</uploadSite>

scmUrl

Path to Git project, for example scm:git:https://github.com/joquijada/element-path-finder.git. The URL must follow the prescribed Apache Maven Project format

Required? Yes

siteUpload

Set the tag value to true (E.g. <siteUpload>true</siteUpload>) to enable uploading of the Maven generated site to GitHub pages. This assumes that (a) your project is hosted on GitHub, and (b) you have enabled GitHub pages for your repository. Read GitHub pages documentation for more info ** Currently only uploading to GitHub pages is supported. In the future might support other kinds of site upload locations. **

Required? No

sitePath

Folder in the remote server where the site gets uploaded. Say the project's associated GitHub page is at http://owner.github.io/project, and you have configure <sitePath>site-project</sitePath>, then the contents will be uploaded to http://owner.github.io/project/site-project

Required? No. Note that if siteUpload is false, then this parameter gets ignored.

siteMerge

Set to true and site contents gets merged when uploaded, but if set to false site contents gets overwritten.

Required> No. Note that if siteUpload is false, then this parameter gets ignored.

packageNames

Comma-separated list of packages to scan for code quality and report on. Example <packageNames>com.foo.*,com.bar.*</packageNames>

Required? Yes

PRs Welcome License: MIT

Versions

Version
1.2.0
1.1.0
1.0.0