Uploaded image for project: 'Maven Checkstyle Plugin'
  1. Maven Checkstyle Plugin
  2. MCHECKSTYLE-415

Fatal Errors in Logs after Upgrade from com.puppycrawl.tools:checkstyle:10.1 to 10.2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • 3.1.2
    • None
    • checkstyle:check
    • Ubuntu 20.04, Jenkins, Docker

    Description

      I reported this originally in the checkstyle issue tracker and Roman Ivanov redirected me here.

      My maven profile is declared like

      <profile>
          <id>checkstyle</id>
      
          <build>
              <pluginManagement>
                  <plugins>
                      <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-checkstyle-plugin</artifactId>
                          <version>3.1.2</version>
      
                          <configuration>
                              <configLocation>.checkstyle/config.xml</configLocation>
                              <includeTestSourceDirectory>true</includeTestSourceDirectory>
                          </configuration>
      
                          <dependencies>
                              <dependency>
                                  <groupId>com.puppycrawl.tools</groupId>
                                  <artifactId>checkstyle</artifactId>
                                  <version>10.1</version>
                              </dependency>
                          </dependencies>
                      </plugin>
                  </plugins>
              </pluginManagement>
          </build>
      </profile>
      

      and outputted normal logs like

      [INFO] --- maven-checkstyle-plugin:3.1.2:check (default-cli) @ my.project ---
      [INFO] You have 0 Checkstyle violations.
      

      When upgrading my maven profile checkstyle-dependeny from 10.1 to 10.2

      <profile>
          <id>checkstyle</id>
      
          <build>
              <pluginManagement>
                  <plugins>
                      <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-checkstyle-plugin</artifactId>
                          <version>3.1.2</version>
      
                          <configuration>
                              <configLocation>.checkstyle/config.xml</configLocation>
                              <includeTestSourceDirectory>true</includeTestSourceDirectory>
                          </configuration>
      
                          <dependencies>
                              <dependency>
                                  <groupId>com.puppycrawl.tools</groupId>
                                  <artifactId>checkstyle</artifactId>
                                  <version>10.2</version>
                              </dependency>
                          </dependencies>
                      </plugin>
                  </plugins>
              </pluginManagement>
          </build>
      </profile>
      

      new confusing fatal messages are printed in the logs:

      [INFO] --- maven-checkstyle-plugin:3.1.2:check (default-cli) @ my.project ---
      [Fatal Error] control.xml:1:1: Content is not allowed in prolog.
      [Fatal Error] control.xml:1:1: Content is not allowed in prolog.
      [Fatal Error] control.xml:1:1: Content is not allowed in prolog.
      [Fatal Error] control.xml:1:1: Content is not allowed in prolog.
      [INFO] You have 0 Checkstyle violations.
      

      It does not affect the build result but confuses developers if something went wrong.

      Roman Ivanov guessed, that the commit https://github.com/checkstyle/checkstyle/issues/11507 could lead to this problem.

      Attachments

        Activity

          People

            Unassigned Unassigned
            minh.do Minh Do
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: