Я получаю Audit errors as below, when try to run
> mvn clean install` мой проект cucumber- java. Все работало нормально. Это происходит внезапно.
Кажется, все ошибки связаны с кодированием. Но когда я собираю и запускаю тесты через IntelliJ 2019.3 Ultimate
, все работает нормально.
[INFO] Starting audit...
[ERROR] C:\Repo\....\cucumber\stepdefinition\CommonStepdefs.java:4: 'cucumber.api.java.en.Given' should be separated from previous imports. [ImportOrder]
[ERROR] C:\Repo\...\cucumber\stepdefinition\CommonStepdefs.java:7: Wrong order for 'common.Utilities' import. [ImportOrder]
[ERROR] C:\Repo\...\src\test\java\common\Utilities.java:27: Line is longer than 120 characters (found 146). [LineLength]
[ERROR] C:\Repo\...\src\test\java\common\Utilities.java:46: Line is longer than 120 characters (found 153). [LineLength]
Audit done.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.344 s
[INFO] Finished at: 2020-02-01T10:27:53+11:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.13:check (validate) on project automation: Failed during checkstyle execution: There are 48 checkstyle errors. -> [Help 1]
Конфигурации Maven:
Maven home: C:\apache-maven-3.6.2\bin\..
Java version: 1.8.0_231, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_231\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Ниже раздел был удален из POM
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.13</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>6.17</version>
</dependency>
<dependency>
<groupId>com.abc.standards.java</groupId>
<artifactId>checkstyle</artifactId>
<version>1.4</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<configLocation>abc-java-checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>false</failsOnError>
<failOnViolation>false</failOnViolation>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>