An open API service indexing awesome lists of open source software.

https://github.com/ragedunicorn/maven-code-quality

A maven dependency for providing code quality presets to projects
https://github.com/ragedunicorn/maven-code-quality

code-quality java

Last synced: 3 months ago
JSON representation

A maven dependency for providing code quality presets to projects

Awesome Lists containing this project

README

        

# maven-code-quality

> A maven dependency for providing code quality presets to projects

[![Maven Central](https://img.shields.io/maven-central/v/com.ragedunicorn.tools.maven/maven-code-quality.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.ragedunicorn.tools.maven%22%20AND%20a:%22maven-code-quality%22)

## How To Use

This dependency is usually not used as a direct dependency to a project but rather by plugin configurations such as pmd and checkstyle.

## Compatibility

Configurations in this artifact need to match with the used checkstyle and pmd version.

Supported Versions:

| | |
|------------|-------|
| Checkstyle | 8.29 |
| PMD | 6.21.0 |

### Checkstyle Usage Example

Maven usage

```
mvn checkstyle:checkstyle
```

```xml

...



org.apache.maven.plugins
maven-checkstyle-plugin


com.ragedunicorn.tools.maven
maven-code-quality
[version]


com.puppycrawl.tools
checkstyle
8.12







org.apache.maven.plugins
maven-jxr-plugin



...

```

Additionally the config and header location properties have to be set in the project pom.

```xml

checkstyle.xml
LICENSE.txt

```

### PMD Usage Example

Maven usage

```
mvn pmd:pmd
```

```xml

...



org.apache.maven.plugins
maven-pmd-plugin
3.10.0


pmd-ruleset.xml

true



com.ragedunicorn.tools.maven
maven-code-quality
[version]


net.sourceforge.pmd
pmd-vm
6.6.0


net.sourceforge.pmd
pmd-xml
6.6.0









org.apache.maven.plugins
maven-jxr-plugin



...

```

## Development

#### Build Project

```
mvn clean install
```

#### Create a Release

This project has GitHub action profiles for different Devops related work such as deployments to different places. See .github folder for details.
The project is deployed to three different places. Each deployment has its own Maven profile for configuration.

##### GitHub Release

`.github/workflows/github_release.yaml` - Creates a tag and release on GitHub

##### GitHub Package Release

`.github/workflows/github_package_release.yaml` - Releases a package on GitHub

##### OSSRH Package Release

`.github/workflows/ossrh_package_release.yaml` - Releases a package on OSSRH (Sonatype)

All steps are required to make a full release of the plugin but can be done independently of each other. The workflows have to be manually invoked on GitHub.

## License

Copyright (c) 2022 Michael Wiesendanger

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.