Build fails when development profile is active due to checkstyle violations (unused imports)

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • #124
    • Yes

      Compiling CraftBukkit
      Picked up _JAVA_OPTIONS: -Djdk.net.URLClassPath.disableClassPathURLCheck=true
      [INFO] Scanning for projects...
      [INFO]
      [INFO] -----------------------< org.bukkit:craftbukkit >-----------------------
      [INFO] Building CraftBukkit 1.16.5-R0.1-SNAPSHOT
      [INFO] --------------------------------[ jar ]---------------------------------
      [INFO]
      [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ craftbukkit ---
      [INFO]
      [INFO] --- scriptus:0.4.1:describe (default) @ craftbukkit ---
      [INFO] Set property "describe" to "dev-Bukkit-e5cb519"
      [INFO] Set property "project.build.outputTimestamp" to "1612568100"
      [INFO]
      [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ craftbukkit ---
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 4 resources
      [INFO]
      [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ craftbukkit ---
      [INFO] Changes detected - recompiling the module!
      [INFO]
      [INFO] --- maven-checkstyle-plugin:3.1.1:check (default) @ craftbukkit ---
      [INFO] There are 13 errors reported by Checkstyle 8.39 with checkstyle.xml ruleset.
      [ERROR] src\main\java\net\minecraft\server\BehaviorInteractDoor.java:[6,8] (imports) UnusedImports: Nicht verwendeter Import - java.util.List.
      [ERROR] src\main\java\net\minecraft\server\CraftingManager.java:[4,8] (imports) UnusedImports: Nicht verwendeter Import - com.google.common.collect.ImmutableMap.Builder.
      [ERROR] src\main\java\net\minecraft\server\CraftingManager.java:[13,8] (imports) UnusedImports: Nicht verwendeter Import - java.util.Collections.
      [ERROR] src\main\java\net\minecraft\server\DedicatedServer.java:[9,8] (imports) UnusedImports: Nicht verwendeter Import - java.io.BufferedReader.
      [ERROR] src\main\java\net\minecraft\server\DedicatedServer.java:[11,8] (imports) UnusedImports: Nicht verwendeter Import - java.io.InputStreamReader.
      [ERROR] src\main\java\net\minecraft\server\DedicatedServer.java:[14,8] (imports) UnusedImports: Nicht verwendeter Import - java.nio.charset.StandardCharsets.
      [ERROR] src\main\java\net\minecraft\server\EntityOcelot.java:[4,8] (imports) UnusedImports: Nicht verwendeter Import - java.util.function.Predicate.
      [ERROR] src\main\java\net\minecraft\server\Main.java:[8,8] (imports) UnusedImports: Nicht verwendeter Import - com.mojang.serialization.DynamicOps.
      [ERROR] src\main\java\net\minecraft\server\Main.java:[9,8] (imports) UnusedImports: Nicht verwendeter Import - com.mojang.serialization.Lifecycle.
      [ERROR] src\main\java\net\minecraft\server\Main.java:[17,8] (imports) UnusedImports: Nicht verwendeter Import - joptsimple.NonOptionArgumentSpec.
      [ERROR] src\main\java\net\minecraft\server\Main.java:[18,8] (imports) UnusedImports: Nicht verwendeter Import - joptsimple.OptionParser.
      [ERROR] src\main\java\net\minecraft\server\Main.java:[20,8] (imports) UnusedImports: Nicht verwendeter Import - joptsimple.OptionSpec.
      [ERROR] src\main\java\net\minecraft\server\ServerConnection.java:[17,8] (imports) UnusedImports: Nicht verwendeter Import - io.netty.channel.socket.ServerSocketChannel.
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  19.198 s
      [INFO] Finished at: 2021-02-06T13:15:26+01:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.1:check (default) on project craftbukkit: You have 13 Checkstyle violations. -> [Help 1]
      [ERROR]
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR]
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

      Seems like Maven / Checkstyle is picking up my system's locale for these error messages, but you can ignore that.

      Building without the --dev flag works fine.

      I also noticed that the checkstyle files for Spigot-API and Spigot-Server keep resetting to their default, even if I use the --dont-update flag. With this flag, and disabling the UnusedImports check, I can get CraftBukkit to build, but the same doesn't work for Spigot because these checksytle configs still reset for some reason.

      When Spigot fails to build, I additionally get a few different violations:

      [INFO] ---------------------< org.spigotmc:spigot-parent >---------------------
      [INFO] Building Spigot-Parent dev-SNAPSHOT                                [2/3]
      [INFO] --------------------------------[ pom ]---------------------------------
      [INFO] 
      [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ spigot-parent ---
      [INFO] 
      [INFO] --- maven-install-plugin:2.4:install (default-install) @ spigot-parent ---
      [INFO] Installing C:\Users\lukas_000\Documents\Minecraft\bukkit-libs\spigot-building\build\Spigot\pom.xml to C:\Users\lukas_000\.m2\repository\org\spigotmc\spigot-parent\dev-SNAPSHOT\spigot-parent-dev-SNAPSHOT.pom
      [INFO] 
      [INFO] ------------------------< org.spigotmc:spigot >-------------------------
      [INFO] Building Spigot 1.16.5-R0.1-SNAPSHOT                               [3/3]
      [INFO] --------------------------------[ jar ]---------------------------------
      [INFO] 
      [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ spigot ---
      [INFO] Deleting C:\Users\lukas_000\Documents\Minecraft\bukkit-libs\spigot-building\build\Spigot\Spigot-Server\target
      [INFO] 
      [INFO] --- scriptus:0.4.1:describe (ex-spigot) @ spigot ---
      [INFO] Set property "spigot.desc" to "dev-Spigot-138d451"
      [INFO] Set property "project.build.outputTimestamp" to "1612048126"
      [INFO] 
      [INFO] --- scriptus:0.4.1:describe (ex-craftbukkit) @ spigot ---
      [INFO] Set property "craftbukkit.desc" to "-e5cb519"
      [INFO] Set property "project.build.outputTimestamp" to "1612568100"
      [INFO] 
      [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ spigot ---
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] Copying 4 resources
      [INFO] 
      [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ spigot ---
      [INFO] Changes detected - recompiling the module!
      [INFO] 
      [INFO] --- maven-checkstyle-plugin:3.1.1:check (default) @ spigot ---
      [INFO] There are 16 errors reported by Checkstyle 8.39 with checkstyle.xml ruleset.
      [ERROR] src\main\java\net\minecraft\server\BehaviorInteractDoor.java:[6,8] (imports) UnusedImports: Nicht verwendeter Import - java.util.List.
      [ERROR] src\main\java\net\minecraft\server\CraftingManager.java:[4,8] (imports) UnusedImports: Nicht verwendeter Import - com.google.common.collect.ImmutableMap.Builder.
      [ERROR] src\main\java\net\minecraft\server\CraftingManager.java:[13,8] (imports) UnusedImports: Nicht verwendeter Import - java.util.Collections.
      [ERROR] src\main\java\net\minecraft\server\DataWatcher.java:[12,8] (imports) UnusedImports: Nicht verwendeter Import - java.util.concurrent.locks.ReadWriteLock.
      [ERROR] src\main\java\net\minecraft\server\DataWatcher.java:[13,8] (imports) UnusedImports: Nicht verwendeter Import - java.util.concurrent.locks.ReentrantReadWriteLock.
      [ERROR] src\main\java\net\minecraft\server\DedicatedServer.java:[9,8] (imports) UnusedImports: Nicht verwendeter Import - java.io.BufferedReader.
      [ERROR] src\main\java\net\minecraft\server\DedicatedServer.java:[11,8] (imports) UnusedImports: Nicht verwendeter Import - java.io.InputStreamReader.
      [ERROR] src\main\java\net\minecraft\server\DedicatedServer.java:[14,8] (imports) UnusedImports: Nicht verwendeter Import - java.nio.charset.StandardCharsets.
      [ERROR] src\main\java\net\minecraft\server\EntityOcelot.java:[4,8] (imports) UnusedImports: Nicht verwendeter Import - java.util.function.Predicate.
      [ERROR] src\main\java\net\minecraft\server\Main.java:[8,8] (imports) UnusedImports: Nicht verwendeter Import - com.mojang.serialization.DynamicOps.
      [ERROR] src\main\java\net\minecraft\server\Main.java:[9,8] (imports) UnusedImports: Nicht verwendeter Import - com.mojang.serialization.Lifecycle.
      [ERROR] src\main\java\net\minecraft\server\Main.java:[17,8] (imports) UnusedImports: Nicht verwendeter Import - joptsimple.NonOptionArgumentSpec.
      [ERROR] src\main\java\net\minecraft\server\Main.java:[18,8] (imports) UnusedImports: Nicht verwendeter Import - joptsimple.OptionParser.
      [ERROR] src\main\java\net\minecraft\server\Main.java:[20,8] (imports) UnusedImports: Nicht verwendeter Import - joptsimple.OptionSpec.
      [ERROR] src\main\java\net\minecraft\server\ServerConnection.java:[17,8] (imports) UnusedImports: Nicht verwendeter Import - io.netty.channel.socket.ServerSocketChannel.
      [ERROR] src\main\java\net\minecraft\server\StructureSettings.java:[7,8] (imports) UnusedImports: Nicht verwendeter Import - java.util.Iterator.
      [INFO] ------------------------------------------------------------------------
      [INFO] Reactor Summary:
      [INFO] 
      [INFO] Spigot-API 1.16.5-R0.1-SNAPSHOT .................... SUCCESS [ 21.554 s]
      [INFO] Spigot-Parent dev-SNAPSHOT ......................... SUCCESS [  0.071 s]
      [INFO] Spigot 1.16.5-R0.1-SNAPSHOT ........................ FAILURE [ 17.612 s]
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  39.347 s
      [INFO] Finished at: 2021-02-06T12:49:16+01:00
      [INFO] ------------------------------------------------------------------------

            Assignee:
            Unassigned
            Reporter:
            blablubbabc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: