项目作者: unchai

项目描述 :
A maven plugin that leaves comment of the result of a "Checkstyle" on github's pull request.
高级语言: Java
项目地址: git://github.com/unchai/checkstyle-github-maven-plugin.git
创建时间: 2018-08-05T15:03:15Z
项目社区:https://github.com/unchai/checkstyle-github-maven-plugin

开源协议:Apache License 2.0

下载


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

  1. <plugins>
  2. ...
  3. <plugin>
  4. <groupId>com.github.unchai</groupId>
  5. <artifactId>checkstyle-github-maven-plugin</artifactId>
  6. <version>LATEST_VERSION</version>
  7. <configuration>
  8. <configLocation>[Checkstyle configuration file]</configLocation>
  9. </configuration>
  10. </plugin>
  11. ...
  12. </plugins>

Usage

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

with Jenkinsfile

  1. node {
  2. stage('lint') {
  3. if (env.CHANGE_ID) {
  4. withCredentials([[$class: 'StringBinding', credentialsId: 'github-bot', variable: 'GITHUB_ACCESS_TOKEN']]) {
  5. sh "'${pwd()}/mvnw' clean checkstyle-github:checkstyle-github" +
  6. " -Dgithub.token=${GITHUB_ACCESS_TOKEN}" +
  7. " -Dgithub.repository=owner/repo" +
  8. " -Dgithub.pullRequest=${env.CHANGE_ID}"
  9. }
  10. }
  11. }
  12. }

License

Apache License 2.0 © 2018 unchai