Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6533

Remapped classes using the specialsource-maven-plugin are not loading

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • None
    • None
    • [21:51:52] [Server thread/INFO]: This server is running CraftBukkit version 3124-Spigot-66f9d3c-384e116 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT) [21:51:52] [Server thread/INFO]: You are running the latest version
    • Yes

      Hello,

      I am trying to use the new remapped-mojang jar as a dependency. This works just fine and everything compiles. I package my jar using the specialsource maven plugin to obfuscate the code once again.

      <plugin>
                      <groupId>net.md-5</groupId>
                      <artifactId>specialsource-maven-plugin</artifactId>
                      <version>1.2.2</version>
                      <executions>
                          <execution>
                              <phase>package</phase>
                              <goals>
                                  <goal>remap</goal>
                              </goals>
                              <id>remap-obf</id>
                              <configuration>
                                  <srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                                  <reverse>true</reverse>
                                  <remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                                  <remappedArtifactAttached>true</remappedArtifactAttached>
                                  <remappedClassifierName>remapped-obf</remappedClassifierName>
                              </configuration>
                          </execution>
                          <execution>
                              <phase>package</phase>
                              <goals>
                                  <goal>remap</goal>
                              </goals>
                              <id>remap-spigot</id>
                              <configuration>
                                  <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                                  <srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
                                  <remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
                              </configuration>
                          </execution>
                      </executions>
                  </plugin>
      

      This generates my remapped jar. This all works fine.

      However when running my plugin I get following error upon instantiating a class using the obfuscated classes:

      java.lang.NoClassDefFoundError: os
              at net.shortninja.staffplus.core.StaffPlus.enable(StaffPlus.java:39) ~[?:?]
              at be.garagepoort.mcioc.TubingPlugin.onEnable(TubingPlugin.java:16) ~[?:?]
              at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
              at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
              at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
              at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:495) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
              at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:409) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
              at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:607) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
              at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:264) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
              at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:986) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
              at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:307) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
              at java.lang.Thread.run(Thread.java:831) [?:?]
      Caused by: java.lang.ClassNotFoundException: os
              at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:142) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
              at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[spigot-1.17.jar:3124-Spigot-66f9d3c-384e116]
              at java.lang.ClassLoader.loadClass(ClassLoader.java:519) ~[?:?]
              ... 12 more
      
      

      It seems he can't resolve the obfuscated classes.
      Am I doing something wrong?

      Thank you

            Unassigned Unassigned
            Garagepoort David Maes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: