{"id":16965150,"url":"https://github.com/gregswindle/maven-code-quality-pom","last_synced_at":"2025-04-11T23:02:30.744Z","repository":{"id":90405149,"uuid":"110059914","full_name":"gregswindle/maven-code-quality-pom","owner":"gregswindle","description":"Enforce and report code quality with JUnit, JaCoCo, Hamcrest, FindBugs, PMD, CodeNarc, Checkstyle (Google), Enforcer, Duplicate-Finder, JDepend, and more with this Maven POM.","archived":false,"fork":false,"pushed_at":"2020-06-01T12:40:22.000Z","size":5425,"stargazers_count":9,"open_issues_count":9,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T18:54:04.774Z","etag":null,"topics":["code-coverage","code-quality","coding-standards","coding-style","java","license-checking","license-management","maven","maven-pom","reporting","reports","test-automation"],"latest_commit_sha":null,"homepage":"https://gregswindle.github.io/maven-code-quality-pom/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregswindle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-09T02:58:59.000Z","updated_at":"2023-02-13T16:17:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"18fa1974-3a01-45d4-a37c-b74fce5a8501","html_url":"https://github.com/gregswindle/maven-code-quality-pom","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregswindle%2Fmaven-code-quality-pom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregswindle%2Fmaven-code-quality-pom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregswindle%2Fmaven-code-quality-pom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregswindle%2Fmaven-code-quality-pom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregswindle","download_url":"https://codeload.github.com/gregswindle/maven-code-quality-pom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248492876,"owners_count":21113163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-coverage","code-quality","coding-standards","coding-style","java","license-checking","license-management","maven","maven-pom","reporting","reports","test-automation"],"created_at":"2024-10-13T23:45:09.805Z","updated_at":"2025-04-11T23:02:30.739Z","avatar_url":"https://github.com/gregswindle.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `maven-code-quality-pom`\n\n\u003e Enforce and report code quality with JUnit, JaCoCo, Hamcrest, FindBugs, PMD, CodeNarc, Checkstyle (Google), Enforcer, Duplicate-Finder, JDepend, and more with this Maven POM.\n\n[![License][license-badge-image]][license-url]\n[![Third-party licenses][fossa-shield-badge]][fossa-shield-url]\n[![Synk Vulnerabilities][snyk-vulnerabilities-badge-image]][snyk-vulnerabilities-url]\n[![Build Status][travis-image]][travis-url]\n[![Coveralls Status][coveralls-image]][coveralls-url]\u003cbr\u003e\n[![Dependency Status][dependencyci-badge-image]][dependencyci-url]\n[![Dependency Status][depstat-image]][depstat-url]\n[![DevDependency Status][depstat-dev-image]][depstat-dev-url]\n[![Greenkeeper badge](https://badges.greenkeeper.io/gregswindle/maven-code-quality-pom.svg?style=flat-square)](https://greenkeeper.io/)\n\n## Table of contents\n\n\u003c!-- ⛔️ AUTO-GENERATED-CONTENT:START (TOC:excludeText=Table of contents) --\u003e\n- [1. Overview](#1-overview)\n- [2. Prerequisite software](#2-prerequisite-software)\n- [3. Installation](#3-installation)\n- [4. Usage](#4-usage)\n  * [4.1. Run unit tests, evaluate complexity, and check coverage](#41-run-unit-tests-evaluate-complexity-and-check-coverage)\n  * [4.2. Generate site files](#42-generate-site-files)\n  * [4.3. Run quality checks](#43-run-quality-checks)\n    + [4.3.1. `mvn fmt:check`](#431-mvn-fmtcheck)\n    + [4.3.2. `mvn enforcer:display-info`](#432-mvn-enforcerdisplay-info)\n    + [4.3.3. `mvn site`](#433-mvn-site)\n    + [4.3.4. `mvn checkstyle:check`](#434-mvn-checkstylecheck)\n    + [4.3.5. `mvn duplicate-finder:check`](#435-mvn-duplicate-findercheck)\n    + [4.3.6. `mvn findbugs:check`](#436-mvn-findbugscheck)\n    + [4.3.7. `mvn pmd:check`](#437-mvn-pmdcheck)\n    + [4.3.8. `mvn pmd:cpd-check`](#438-mvn-pmdcpd-check)\n  * [4.3. Export reports to SonarCloud.io](#43-export-reports-to-sonarcloudio)\n- [5. Semantic version and `CHANGELOG`](#5-semantic-version-and-changelog)\n- [6. Contributing to `maven-code-quality-pom`](#6-contributing-to-maven-code-quality-pom)\n- [7. License](#7-license)\n\u003c!-- ⛔️ AUTO-GENERATED-CONTENT:END --\u003e\n\n\n## 1. Overview\n\nEnforce and report code quality with:\n\n  1. **Checkstyle** with Google Java coding standards ([`maven-checkstyle-plugin`](http://maven.apache.org/plugins/maven-checkstyle-plugin/))\n  1. **CodeNarc** ([`codenarc-maven-plugin`](http://mojo.codehaus.org/codenarc-maven-plugin))\n  1. **Duplicate-Finder** ([`duplicate-finder-maven-plugin`](https://github.com/basepom/duplicate-finder-maven-plugin))\n  1. **Enforcer** ([`maven-enforcer-plugin`](http://maven.apache.org/enforcer/maven-enforcer-plugin/))\n  1. **FindBugs** ([`findbugs-maven-plugin`](http://gleclaire.github.io/findbugs-maven-plugin/))\n  1. **fmt-maven-plugin** formats your code using [`google-java-format`](https://github.com/google/google-java-format), which follows [Google's code styleguide](https://google.github.io/styleguide/javaguide.html) ([`fmt-maven-plugin`](https://github.com/coveo/fmt-maven-plugin))\n  1. **JDepend** ([`jdepend-maven-plugin`](http://mojo.codehaus.org/jdepend-maven-plugin))\n  1. **JUnit** ([`junit5`](http://junit.org/junit5/) with [`junit4`](http://junit.org/junit4/) backwards compatibility)\n  1. **JaCoCo** ([`jacoco-maven-plugin`](http://www.eclemma.org/jacoco/trunk/doc/maven.html))\n  1. **PMD** ([`maven-pmd-plugin`](https://maven.apache.org/plugins/maven-pmd-plugin/))\n  1. **Report site** generation ([`maven-site-plugin`](https://maven.apache.org/plugins/maven-site-plugin/))\n\nand more with this Maven POM.\n\n---\n\nThe **purpose of the project** is to use the Maven Site Plugin to:\n\n  1. Use the Maven Site Plugin to generate meaningful test and quality reporting artifacts\n  1. Enforce test coverage thresholds and code standards\n  1. Prevent source code that does not conform to standards from being merged into `master`.\n\n## 2. Prerequisite software\n\n[![Java logo](./docs/img/icon-java-logo.png)]][java-jdk-dl-url]\n[![Maven logo](./docs/img/icon-maven-logo.png)][maven-url]\n[![Node.js logo](./docs/img/icons8/icon-nodejs-96.png)][nodejs-url]\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n[![npm logo][npm-logo]][npmjs-url]\n\n`maven-code-quality-pom` is written in Java, which must be installed prior to use. `maven-code-quality-pom` manages Java dependencies with Maven and NPM for JavaScript dependencies.\n\n 1. **Java\u003csup\u003e:tm:\u003c/sup\u003e EE 8 SDK:** Either\n    - [`oracle64-1.8.x1`][java-jdk-dl-url] or\n    - [`openjdk:8-jdk-alpine`](https://github.com/docker-library/openjdk/blob/b4f29ba829765552239bd18f272fcdaf09eca259/8-jdk/alpine/Dockerfile)\n\n 1. [**Maven**][maven-dl-url]\n 1. [**Node.js**][nodejs-url], which includes the [node package manager (**npm**)][npmjs-url].\n\n\n## 3. Installation\n\u003e :bulb: If you're working on macOS, we recommend installing or updating software with [Homebrew](https://brew.sh/).\n\n  1. Fork or clone this repository.\n\n  ```bash\n  $ git clone https://github.com/gregswindle/maven-code-quality-pom.git\n  $ cd maven-code-quality-pom\n  ```\n\n  1. Install with Maven:\n\n  ```bash\n  $ mvn clean install -DskipTests=true -Dmaven.javadocs.skip=true -B -V\n  ```\n\n  1. Install Node.js dependencies:\n\n  ```bash\n  $ npm install\n  ```\n\n## 4. Usage\n\n### 4.1. Run unit tests, evaluate complexity, and check coverage\n\n```bash\n$ mvn test verify\n```\n\n### 4.2. Generate site files\n\nTo build the Maven reports site, open a Terminal and run:\n\n```bash\n$ mvn site\n```\n\nThen open `maven-code-quality-pom/target/site/index.html` in a Web browser.\n\n### 4.3. Run quality checks\n\n- #### 4.3.1. `mvn fmt:check`\n\n  \u003e Formats all src/ and test/ Java code according to the Google Java style guide.\n\n  \u003e :information_source: `mvn fmt:format` runs with every build.\n\n- #### 4.3.2. `mvn enforcer:display-info`\n\n  \u003e Executes the defined enforcer-rules once per module and displays the current platform information\n\n- #### 4.3.3. `mvn site`\n\n  \u003e Generates the site for a single project.\n\n- #### 4.3.4. `mvn checkstyle:check`\n\n  \u003e Performs Checkstyle analysis and outputs violations or a count of violations to the console, potentially failing the build.\n\n- #### 4.3.5. `mvn duplicate-finder:check`\n\n  \u003e Finds duplicate classes/resources on the classpath.\n\n- #### 4.3.6. `mvn findbugs:check`\n\n  \u003e Identify defect (bug) patterns in your Java source code.\n\n- #### 4.3.7. `mvn pmd:check`\n\n  \u003e Fail the build if there were any PMD violations in the source code.\n\n- #### 4.3.8. `mvn pmd:cpd-check`\n\n  \u003e Fail the build if there were any CPD violations in the source code.\n\n### 4.3. Export reports to SonarCloud.io\n[![SonarCloud logo][sonar-cloud-icon]][sonar-cloud-url]\n\n\u003e **Before you connect to SonarCloud, you need:**\n\u003e\n\u003e  - An active account on https://sonarcloud.io\n\u003e  - To set the `ENVIRONMENT` variable `$SONAR_TOKEN`\n\u003e\n\u003e [See \"Using SonarCloud with Travis CI\"](https://docs.travis-ci.com/user/sonarcloud) for details.\n\nOpen a Terminal and run:\n\n```bash\n$ mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar\n```\n\n\u003e [View reports on SonarCloud](https://sonarcloud.io/dashboard?id=gregswindle-github).\n\n## 5. Semantic version and `CHANGELOG`\n\nThe latest version of `maven-code-quality-pom` is `0.0.1-SNAPSHOT`. View the [`CHANGELOG`][changelog-url] for details.\n\n## 6. Contributing to `maven-code-quality-pom`\n\n\u003e [![Learn how to make a Pull Request with free training][prs-welcome-badge-image]][prs-welcome-url]\n\u003e\n\u003e We welcome contributors with [Pull Requests][prs-welcome-url]!\n\n**[:four_leaf_clover: Read Contributing to `maven-code-quality-pom` to get started. :four_leaf_clover:][contributing-url]**\n\nContributions in the form of GitHub pull requests are welcome. Before embarking on a significant change, please adhere to the following guidelines:\n\n  1. Read the [Code of Conduct][code-of-conduct-url].\n  1. Create an issue to discuss the proposed change and ensure that it is likely to be merged:\n      - [Report a defect][issues-new-defect-url] (aka \"bug\")\n      - [Request a new feature][issues-new-feat-url]\n  1. Follow [Contributing to `maven-code-quality-pom`][contributing-url]'s coding conventions and Git workflow if you're willing and able to program (or want to learn how).\n\n## 7. License\n\n[MIT][license-url] © [Greg Swindle][author-url].\n\n[![FOSSA Status][fossa-large-badge]][fossa-large-url]\n\n\n\u003c!-- ⛔️ 📝 NOTE: PLEASE ALPHABETIZE LINK REFERENCES. 📝 ⛔️ --\u003e\n\n[author-url]: https://github.com/gregswindle\n[changelog-url]: ./CHANGELOG.md\n[code-of-conduct-url]: ./CODE_OF_CONDUCT.md\n[contributing-url]: ./CONTRIBUTING.md\n[coveralls-image]: https://img.shields.io/coveralls/gregswindle/maven-code-quality-pom/master.svg?style=flat-square\n[coveralls-url]: https://coveralls.io/r/gregswindle/maven-code-quality-pom\n[dependencyci-badge-image]: https://dependencyci.com/github/gregswindle/maven-code-quality-pom/badge\n[dependencyci-url]: https://dependencyci.com/github/gregswindle/maven-code-quality-pom\n[depstat-dev-image]: https://david-dm.org/gregswindle/maven-code-quality-pom/dev-status.svg?style=flat-square\n[depstat-dev-url]: https://david-dm.org/gregswindle/maven-code-quality-pom#info=devDependencies\n[depstat-image]: https://david-dm.org/gregswindle/maven-code-quality-pom.svg?style=flat-square\n[depstat-url]: https://david-dm.org/gregswindle/maven-code-quality-pom\n[fossa-large-badge]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fgregswindle%2Fmaven-code-quality-pom.svg?type=large\n[fossa-large-url]: https://app.fossa.io/projects/git%2Bgithub.com%2Fgregswindle%2Fmaven-code-quality-pom?ref=badge_large\n[fossa-shield-badge]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fgregswindle%2Fmaven-code-quality-pom.svg?type=shield\n[fossa-shield-url]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fgregswindle%2Fmaven-code-quality-pom.svg?type=shield\n[issues-new-defect-url]: /gregswindle/maven-code-quality-pom.git/issues/new?title=fix%28affected-scope%29%3A+subject-line-with-very-few-words\u0026labels=Priority%3A+Medium%2CStatus%3A+Review+Needed%2CType%3A+Defect\u0026body=%2A%2A%F0%9F%92%A1+TIP%3A%2A%2A+Select+the+%E2%86%96%EF%B8%8E%E2%8E%BE+Preview+%E2%8F%8B+Tab+above+help+read+these+instructions.%0D%0A%0D%0A%23%23+1.+Issue+type%0D%0A%3E%E2%8C%A6+Type+the+letter+%22x%22+in+the+%22checkbox%22+the+best+describe+this+issue.%0D%0A%0D%0A-+%5Bx%5D+__Feature%3A__+I%27m+requesting+a+product+enhancement.%0D%0A%0D%0A%23%23+2.+User+story+summary%0D%0A%3E%E2%8C%A6+Describe+what+you+want+to+accomplish%2C+in+what+role%2Fcapacity%2C+and+why+it%27s+important+to+you.%0D%0A%0D%0A%3E+__EXAMPLE%3A__%0D%0A%3E+As+a+Applicant%2C%0D%0A%3E+I+want+to+submit+my+resume%0D%0A%3E+In+order+to+be+considered+for+a+job+opening.%0D%0A%0D%0AAs+a+%7Brole%7D%2C%0D%0AI+must%2Fneed%2Fwant%2Fshould+%7Bdo+something%7D%0D%0AIn+order+to+%7Bachieve+value%7D.%0D%0A%0D%0A%23%23+3.+Acceptance+criteria%0D%0A%3E%E2%8C%A6+Replace+the+examples+below+with+your+own+imperative%2C+%22true%2Ffalse%22+statements+for+the+__behavior+you+expect__+to+see%2C+or+the+behavior+that+__would__+be+true+if+there+were+no+errors+%28for+defects%29.%0D%0A%0D%0A-+%5B+%5D+1.+Job+Applicants+receive+a+confirmation+email+after+they+submit+their+resumes.%0D%0A-+%5B+%5D+2.+An+Applicant%27s+resume+information+isn%27t+lost+when+errors+occur.%0D%0A-+%5B+%5D+3.+%7Bcriterion-three%7D%0D%0A-+%5B+%5D+4.+%7Bcriterion-four%7D%0D%0A%0D%0A%3C%21--+%E2%9B%94%EF%B8%8F++Do+not+remove+anything+below+this+comment.+%E2%9B%94%EF%B8%8F++--%3E%0D%0A%5Bicon-info-image%5D%3A+..%2Fdocs%2Fimg%2Ficons8%2Ficon-info-50.png%0D%0A\n[issues-new-feat-url]: /gregswindle/maven-code-quality-pom.git/issues/new?title=feat%28affected-scope%29%3A+subject-line-with-very-few-words\u0026labels=Priority%3A+Medium%2CStatus%3A+Review+Needed%2CType%3A+Feature\u0026body=%2A%2A%F0%9F%92%A1+TIP%3A%2A%2A+Select+the+%E2%86%96%EF%B8%8E%E2%8E%BE+Preview+%E2%8F%8B+Tab+above+help+read+these+instructions.%0D%0A%0D%0A%23%23+1.+Issue+type%0D%0A%3E%E2%8C%A6+Type+the+letter+%22x%22+in+the+%22checkbox%22+the+best+describe+this+issue.%0D%0A%0D%0A-+%5Bx%5D+__Feature%3A__+I%27m+requesting+a+product+enhancement.%0D%0A%0D%0A%23%23+2.+User+story+summary%0D%0A%3E%E2%8C%A6+Describe+what+you+want+to+accomplish%2C+in+what+role%2Fcapacity%2C+and+why+it%27s+important+to+you.%0D%0A%0D%0A%3E+__EXAMPLE%3A__%0D%0A%3E+As+a+Applicant%2C%0D%0A%3E+I+want+to+submit+my+resume%0D%0A%3E+In+order+to+be+considered+for+a+job+opening.%0D%0A%0D%0AAs+a+%7Brole%7D%2C%0D%0AI+must%2Fneed%2Fwant%2Fshould+%7Bdo+something%7D%0D%0AIn+order+to+%7Bachieve+value%7D.%0D%0A%0D%0A%23%23+3.+Acceptance+criteria%0D%0A%3E%E2%8C%A6+Replace+the+examples+below+with+your+own+imperative%2C+%22true%2Ffalse%22+statements+for+the+__behavior+you+expect__+to+see%2C+or+the+behavior+that+__would__+be+true+if+there+were+no+errors+%28for+defects%29.%0D%0A%0D%0A-+%5B+%5D+1.+Job+Applicants+receive+a+confirmation+email+after+they+submit+their+resumes.%0D%0A-+%5B+%5D+2.+An+Applicant%27s+resume+information+isn%27t+lost+when+errors+occur.%0D%0A-+%5B+%5D+3.+%7Bcriterion-three%7D%0D%0A-+%5B+%5D+4.+%7Bcriterion-four%7D%0D%0A%0D%0A%3C%21--+%E2%9B%94%EF%B8%8F++Do+not+remove+anything+below+this+comment.+%E2%9B%94%EF%B8%8F++--%3E%0D%0A%5Bicon-info-image%5D%3A+..%2Fdocs%2Fimg%2Ficons8%2Ficon-info-50.png%0D%0A\n[java-jdk-dl-url]: http://www.oracle.com/technetwork/java/javaee/downloads/index.html\n[license-badge-image]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square\n[license-choose-url]: https://choosealicense.com/\n[license-no-license-url]: https://choosealicense.com/no-license/\n[license-unlicense-url]: https://choosealicense.com/licenses/#unlicense\n[license-url]: ./LICENSE\n[maven-url]: https://maven.apache.org/\n[maven-dl-url]: http://maven.apache.org/download.cgi\n[nodejs-url]: https://nodejs.org\n[npmjs-url]: https://www.npmjs.com/\n[npm-logo]: ./docs/img/icons8/icon-npm-100.png\n[prs-welcome-badge-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[prs-welcome-url]: http://makeapullrequest.com\n[snyk-vulnerabilities-badge-image]: https://snyk.io/test/github/gregswindle/maven-code-quality-pom/badge.svg?style=flat-square\n[snyk-vulnerabilities-url]: https://snyk.io/test/github/gregswindle/maven-code-quality-pom\n[sonar-cloud-icon]: ./docs/img/logo-sonar-cloud.png\n[sonar-cloud-url]: https://sonarcloud.io/dashboard?id=gregswindle-github\n[travis-image]: https://img.shields.io/travis/gregswindle/maven-code-quality-pom/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/gregswindle/maven-code-quality-pom\n[versioneye-badge-image]: https://www.versioneye.com/user/projects/5a012f2f2de28c58f8c7a10f/badge.svg?style=flat-square\n[versioneye-url]: https://www.versioneye.com/user/projects/5a012f2f2de28c58f8c7a10f\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregswindle%2Fmaven-code-quality-pom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregswindle%2Fmaven-code-quality-pom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregswindle%2Fmaven-code-quality-pom/lists"}