[Codenarc-user] Custom Ruleset in Maven Project
Brought to you by:
chrismair
From: Eric W. <eri...@gm...> - 2014-09-22 21:12:46
|
Hi All, I'm new to CodeNarc (sorry if this is the wrong place to ask this question!) and I've been trying to integrate it into a maven project. I want to use a custom ruleset, so I built an dummy XML ruleset to test it out. However, when I run mvn clean install, it doesn't appear that my rules are actually being enforced. When I remove the <rulesetfiles> tag in the POM, it works correctly, enforcing the default rules. Does anybody see something I'm doing wrong for my custom ruleset to work? Thanks everyone! -Eric Wehrmeister (see XML below) Here's my custom ruleset and my plugin configuration: <ruleset xmlns="http://codenarc.org/ruleset/1.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://codenarc.org/ruleset/1.0 > http://codenarc.org/ruleset-schema.xsd" > xsi:noNamespaceSchemaLocation=" > http://codenarc.org/ruleset-schema.xsd"> > > <description>Dummy rule set</description> > > <rule class='org.codenarc.rule.formatting.SpaceAfterIf'> > <property name='priority' value='1'/> > </rule> > > <rule class='org.codenarc.rule.basic.EmptyIfStatement'> > <property name='priority' value='1'/> > </rule> > > </ruleset> > I referenced this ruleset in my POM like this: <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>codenarc-maven-plugin</artifactId> > <version>0.18-1</version> > <configuration> > <sourceDirectory>${basedir}/src/test/groovy</sourceDirectory> > <maxPriority1Violations>0</maxPriority1Violations> > <maxPriority2Violations>0</maxPriority2Violations> > <maxPriority3Violations>0</maxPriority3Violations> > <rulesetfiles>${basedir}/rulesets/ruleset.xml</rulesetfiles> > <xmlOutputDirectory>${basedir}/</xmlOutputDirectory> > </configuration> > <executions> > <execution> > <id>execution1</id> > <phase>install</phase> > <goals> > <goal>codenarc</goal> > </goals> > </execution> > </executions> > </plugin> > |