我正在使用Eclipse中的Java multimodule項目。而且我必須將Checkstyle配置到我的Maven構建中,並且在發生任何違規時都會使構建失敗。 我發現這個網站上的推薦使用這個教程:https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html我決定跟着它。無法在Maven多模塊項目中配置Checkstyle
我已經添加了新的子文件夾構建工具我checkstyle.xml並取得了項目的pom.xml中的所有變化
主要的pom.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ss.ita</groupId>
<artifactId>jresume</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>JResume</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.16</version>
<dependencies>
<dependency>
<groupId>com.softserveinc.ita</groupId>
<artifactId>build-tools</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.16</version>
<configuration>
<configLocation>build-tools/src/main/resources/jresume/checkstyle.xml</configLocation>
<headerLocation>build-tools/src/main/resources/jresume/LICENSE.txt</headerLocation>
<failsOnError>true</failsOnError>
</configuration>
</plugin>
</plugins>
</reporting>
<modules>
<module>common</module>
<module>persistence</module>
<module>business</module>
<module>logging</module>
<module>web</module>
<module>build-tools</module>
</modules>
</project>
當我寫一些檢查式違規的java代碼Maven安裝給了我SUCCES但我必須失敗項目b由於違規行爲。我哪裏出錯了?也許我寫了錯誤的路徑到我的checkstyle.xml?請幫幫我。