Alvinn8 / paper-nms-maven-plugin

A maven plugin for using NMS on paper with Mojang mappings.
MIT License
115 stars 8 forks source link

remap failed: Duplicate key #32

Open LoneDev6 opened 1 week ago

LoneDev6 commented 1 week ago

On rare occasions I get this error when running package command. I managed to fix it by deleting the .paper-nms/classes.json file which for some reason gets bugged.

Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal ca.bkaw:paper-nms-maven-plugin:1.4.4:remap failed: Duplicate key "dev\lone\itemsadder\nms\entity\impl\EntityNms_v1_20_6.class" at 8304 [character 8305 line 1]
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute (BuildCacheMojosExecutionStrategy.java:127)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:193)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:180)
    at java.util.concurrent.FutureTask.run$$$capture (FutureTask.java:317)
    at java.util.concurrent.FutureTask.run (FutureTask.java)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:572)
    at java.util.concurrent.FutureTask.run$$$capture (FutureTask.java:317)
    at java.util.concurrent.FutureTask.run (FutureTask.java)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1144)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:642)
    at java.lang.Thread.run (Thread.java:1583)
Caused by: org.json.JSONException: Duplicate key "dev\lone\itemsadder\nms\entity\impl\EntityNms_v1_20_6.class" at 8304 [character 8305 line 1]
    at org.json.JSONTokener.syntaxError (JSONTokener.java:503)
    at org.json.JSONObject.<init> (JSONObject.java:234)
    at ca.bkaw.papernmsmavenplugin.RemappedClasses.<init> (RemappedClasses.java:34)
    at ca.bkaw.papernmsmavenplugin.RemapMojo.remapClasses (RemapMojo.java:168)
    at ca.bkaw.papernmsmavenplugin.RemapMojo.execute (RemapMojo.java:141)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute (BuildCacheMojosExecutionStrategy.java:127)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:193)
    at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call (MultiThreadedBuilder.java:180)
    at java.util.concurrent.FutureTask.run$$$capture (FutureTask.java:317)
    at java.util.concurrent.FutureTask.run (FutureTask.java)
    at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:572)
    at java.util.concurrent.FutureTask.run$$$capture (FutureTask.java:317)
    at java.util.concurrent.FutureTask.run (FutureTask.java)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1144)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:642)
    at java.lang.Thread.run (Thread.java:1583)

This might be worth being added to the readme or would be better to implement a regeneration of the json file in case of duplicate keys, maybe?