checkstyle не поднимает папку src / test - PullRequest
1 голос
/ 16 апреля 2019

я добавил checkstyle в maven build, но по какой-то причине он только проверяет папку src / main и игнорирует папку src / test, вот моя структура проекта:

Proj
 - Module A
   - src
     - main
       - java
       - resources
     - test
       - java
       - resources
 - Module B
   - src
     - main
       - java
       - resources
     - test
       - java
       - resources
 pom.xml
 checkstyle.xml

и мой pom.xml

     <properties>
        <checkstyle.version>3.0.0</checkstyle.version>
        <checkstyle.config.location>checkstyle.xml</checkstyle.config.location>
        <checkstyle.consoleOutput>true</checkstyle.consoleOutput>
        <checkstyle.failOnViolation>true</checkstyle.failOnViolation>
        <encoding>UTF-8</encoding>
    </properties>

   <build>
        <pluginManagement>
            <plugins>
                ...
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${checkstyle.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>8.18</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <configuration>
                                <testSourceDirectories>src/test/java</testSourceDirectories>

         <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            </configuration>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
...