Checkstyle github pull request maven plugin

A maven plug-in that leaves the result of a checkstyle of a project as a comment on github's pull request.

License

License

Categories

Categories

Maven Build Tools Github Development Tools Version Controls Checkstyle Application Testing & Monitoring Code Analysis
GroupId

GroupId

com.github.unchai
ArtifactId

ArtifactId

checkstyle-github-maven-plugin
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Checkstyle github pull request maven plugin
A maven plug-in that leaves the result of a checkstyle of a project as a comment on github's pull request.
Project URL

Project URL

https://github.com/unchai/checkstyle-github-maven-plugin
Project Organization

Project Organization

The Apache Software Foundation
Source Code Management

Source Code Management

https://github.com/unchai/checkstyle-github-maven-plugin

Download checkstyle-github-maven-plugin

How to add to project

<plugin>
    <groupId>com.github.unchai</groupId>
    <artifactId>checkstyle-github-maven-plugin</artifactId>
    <version>0.0.1</version>
</plugin>

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.5.4
org.apache.maven : maven-project jar 2.2.1
org.kohsuke : github-api jar 1.93
com.puppycrawl.tools : checkstyle jar 8.2

provided (1)

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

test (5)

Group / Artifact Type Version
junit : junit jar 4.12
org.hamcrest : hamcrest-all jar 1.3
org.mockito : mockito-core jar 2.8.9
org.powermock : powermock-module-junit4 jar 1.7.4
org.powermock : powermock-api-mockito2 jar 1.7.4

Project Modules

There are no modules declared in this project.

checkstyle-github-maven-plugin

Build Status

A maven plugin that leaves comment of the result of a "Checkstyle" on github's pull request.

Example

Requirements

  • Maven 3
  • Java 8

Install

<plugins>
    ...
    <plugin>
        <groupId>com.github.unchai</groupId>
        <artifactId>checkstyle-github-maven-plugin</artifactId>
        <version>LATEST_VERSION</version>
        <configuration>
            <configLocation>[Checkstyle configuration file]</configLocation>
        </configuration>
    </plugin>
    ...
</plugins>

Usage

$ mvn checkstyle-github:checkstyle-github \
    -Dgithub.endpoint=<github endpoint url> \
    -Dgithub.token=<github oauth token> \
    -Dgithub.repository=<owner/repositoryname> \
    -Dgithub.pullRequest=<pull request id>

with Jenkinsfile

node {
    stage('lint') {
        if (env.CHANGE_ID) {
            withCredentials([[$class: 'StringBinding', credentialsId: 'github-bot', variable: 'GITHUB_ACCESS_TOKEN']]) {
                sh "'${pwd()}/mvnw' clean checkstyle-github:checkstyle-github" +
                   " -Dgithub.token=${GITHUB_ACCESS_TOKEN}" +
                   " -Dgithub.repository=owner/repo" +
                   " -Dgithub.pullRequest=${env.CHANGE_ID}"
            }
        }
    }
}

License

Apache License 2.0 © 2018 unchai

Versions

Version
0.0.1