Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I configure checkstyle in maven?
    primarykey
    data
    text
    <p>I am using Maven<br> I have a parent module and some other modules. They look like: </p> <pre> PARENT ├── pom.xml ├── ModulA | └── pom.xml └── ModulB ├── pom.xml └── folder └── checkstyle.xml </pre> <p>I tried to replace the rules with my own rules. But it ignores my rules. I added the plug-in to parent pom.xml</p> <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-checkstyle-plugin&lt;/artifactId&gt; &lt;version&gt;2.9.1&lt;/version&gt; &lt;configuration&gt; &lt;includeTestSourceDirectory&gt;true&lt;/includeTestSourceDirectory&gt; &lt;configLocation&gt; ${basedir}/../ModulB/folder/checkstyle.xml &lt;/configLocation&gt; &lt;/configuration&gt; &lt;/plugin&gt; </code></pre> <p>Where is the problem?</p> <p><strong>EDIT:</strong></p> <hr> <p>mvn checkstyle:checkstyle -X</p> <pre class="lang-xml prettyprint-override"><code>... &lt;configuration&gt; &lt;cacheFile default-value="${project.build.directory}/checkstyle-cachefile"/&gt; &lt;configLocation default-value="config/sun_checks.xml"&gt;${checkstyle.config.location}&lt;/configLocation&gt; &lt;consoleOutput default-value="false"/&gt; &lt;enableFilesSummary default-value="true"&gt;${checkstyle.enable.files.summary}&lt;/enableFilesSummary&gt; &lt;enableRSS default-value="true"&gt;${checkstyle.enable.rss}&lt;/enableRSS&gt; &lt;enableRulesSummary default-value="true"&gt;${checkstyle.enable.rules.summary}&lt;/enableRulesSummary&gt; &lt;enableSeveritySummary default-value="true"&gt;${checkstyle.enable.severity.summary}&lt;/enableSeveritySummary&gt; &lt;encoding default-value="${project.build.sourceEncoding}"&gt;${encoding}&lt;/encoding&gt; &lt;excludes&gt;${checkstyle.excludes}&lt;/excludes&gt; &lt;failsOnError default-value="false"/&gt; &lt;format default-value="sun"/&gt; &lt;headerFile&gt;${basedir}/LICENSE.txt&lt;/headerFile&gt; &lt;headerLocation default-value="LICENSE.txt"&gt;${checkstyle.header.file}&lt;/headerLocation&gt; &lt;includeTestSourceDirectory default-value="${false}"/&gt; &lt;includes default-value="**/*.java"&gt;${checkstyle.includes}&lt;/includes&gt; &lt;linkXRef default-value="true"&gt;${linkXRef}&lt;/linkXRef&gt; &lt;outputDirectory default-value="${project.reporting.outputDirectory}"/&gt; &lt;outputFile default-value="${project.build.directory}/checkstyle-result.xml"&gt;${checkstyle.output.file}&lt;/outputFile&gt; &lt;outputFileFormat default-value="xml"&gt;${checkstyle.output.format}&lt;/outputFileFormat&gt; &lt;project default-value="${project}"/&gt; &lt;propertiesLocation&gt;${checkstyle.properties.location}&lt;/propertiesLocation&gt; &lt;skip default-value="false"&gt;${checkstyle.skip}&lt;/skip&gt; &lt;sourceDirectory default-value="${project.build.sourceDirectory}"/&gt; &lt;suppressionsFileExpression default-value="checkstyle.suppressions.file"&gt;${checkstyle.suppression.expression}&lt;/suppressionsFileExpression&gt; &lt;suppressionsLocation&gt;${checkstyle.suppressions.location}&lt;/suppressionsLocation&gt; &lt;testSourceDirectory default-value="${project.build.testSourceDirectory}"/&gt; &lt;xrefLocation default-value="${project.reporting.outputDirectory}/xref"/&gt; &lt;/configuration&gt; ... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload