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

https://github.com/sciencesakura/codenarc-maven-plugin

A Maven plugin that integrates CodeNarc, a static analysis tool for Groovy code.
https://github.com/sciencesakura/codenarc-maven-plugin

codenarc maven-plugin

Last synced: 4 months ago
JSON representation

A Maven plugin that integrates CodeNarc, a static analysis tool for Groovy code.

Awesome Lists containing this project

README

          

# CodeNarc Maven Plugin

![](https://github.com/sciencesakura/codenarc-maven-plugin/actions/workflows/build.yaml/badge.svg) [![Maven Central](https://maven-badges.sml.io/sonatype-central/com.sciencesakura/codenarc-maven-plugin/badge.svg)](https://maven-badges.sml.io/sonatype-central/com.sciencesakura/codenarc-maven-plugin)

A Maven plugin that integrates [CodeNarc](https://codenarc.org/), a static analysis tool for Groovy.

## Requirements

* Java 11+
* Maven 3.6.3+

## Installation and usage

The CodeNarc Maven Plugin is available on Maven Central. Add the `` element to your `pom.xml` as shown below:

```xml


...

com.sciencesakura
codenarc-maven-plugin
1.0.0




check




```

### Configuring rules

By default, the CodeNarc Maven Plugin looks for a ruleset file at `${project.basedir}/config/codenarc/codenarc.xml`. If the file does not exist, the plugin falls back to the built-in `rulesets/basic.xml` ruleset.

You can specify the ruleset by setting the `ruleset` parameter.

```xml

com.sciencesakura
codenarc-maven-plugin
1.0.0


rulesets/basic.xml,rulesets/groovyism.xml

${project.basedir}/my-codenarc-ruleset.xml

```

### Override CodeNarc version

You can override the CodeNarc version by adding a dependency to the `` element.

**CAUTION**: The CodeNarc Maven Plugin is built against Groovy 4. Make sure to use a compatible CodeNarc version (e.g., `x.x.x-groovy-4.x`).

```xml

com.sciencesakura
codenarc-maven-plugin
1.0.0


org.codenarc
CodeNarc
${codenarc.version}

```

### Other configurations

The following configuration parameters and their default values are available:

```xml

com.sciencesakura
codenarc-maven-plugin
1.0.0




**/*.groovy


${project.basedir}/config/codenarc/codenarc.xml
${project.build.directory}/CodeNarcXmlReport.xml
false
false
true
true

```

For more information, see the [Maven site](https://www.sciencesakura.com/codenarc-maven-plugin/plugin-info.html).

## Acknowledgments

* [gleclaire/codenarc-maven-plugin](https://github.com/gleclaire/codenarc-maven-plugin) - The original CodeNarc Maven Plugin.

## License

This plugin is licensed under the Apache License 2.0.

Copyright (c) 2026 sciencesakura.