WesJD / AnvilGUI

Capture user input in Minecraft through an anvil GUI in under 20 lines of code
MIT License
466 stars 111 forks source link

Cant shade the AnvilGUI into the plugin #289

Closed skylerush closed 10 months ago

skylerush commented 10 months ago
  <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-shade-plugin</artifactId>
      <version>3.4.1</version>
      <executions>
          <execution>
              <id>shade-net.wesjd.anvilgui</id>
              <phase>package</phase>
              <goals>
                  <goal>shade</goal>
              </goals>
              <configuration>
                  <relocations>
                      <relocation>
                          <pattern>net.wesjd.anvilgui</pattern>
                          <shadedPattern>sagi.plugin.anvilgui</shadedPattern>
                      </relocation>
                  </relocations>
                  <filters>
                      <filter>
                          <artifact>*:*</artifact>
                          <excludeDefaults>false</excludeDefaults>
                          <includes>
                              <include>sagi.plugin.anvilgui</include>
                          </includes>
                      </filter>
                  </filters>
              </configuration>
          </execution>
          <execution>
              <id>shade-net.jitse.npclib</id>
              <phase>package</phase>
              <goals>
                  <goal>shade</goal>
              </goals>
              <configuration>
                  <relocations>
                      <relocation>
                          <pattern>net.jitse.npclib</pattern>
                          <shadedPattern>sagi.plugin.npclib</shadedPattern>
                      </relocation>
                  </relocations>
              </configuration>
          </execution>
          <execution>
              <id>shade-com.cryptomorin.xseries</id>
              <phase>package</phase>
              <goals>
                  <goal>shade</goal>
              </goals>
              <configuration>
                  <relocations>
                      <relocation>
                          <pattern>com.cryptomorin.xseries</pattern>
                          <shadedPattern>sagi.plugin.utils</shadedPattern>
                      </relocation>
                  </relocations>
                  <filters>
                      <filter>
                          <artifact>*:*</artifact>
                          <excludes>
                              <exclude>com/cryptomorin/xseries/XBiome*</exclude>
                              <exclude>com/cryptomorin/xseries/NMSExtras*</exclude>
                              <exclude>com/cryptomorin/xseries/NoteBlockMusic*</exclude>
                              <exclude>com/cryptomorin/xseries/SkullCacheListener*</exclude>
                          </excludes>
                      </filter>
                  </filters>
              </configuration>
          </execution>
      </executions>
  </plugin>

this is my current pom.xml I tried many variations to achieve it I would really appreciate it if someone would be able to help me

the error Because net/wesjd/anvilgui/AnvilGUI$StateSnapshot does not exist.

the compile command (on vscode) mvn package -f "d:\minecraft plugins env\testplugin\staging\pom.xml"

joestr commented 10 months ago

According to the Maven Shade Documentation, <include> should be net/wesjd/anvilgui/**. Maybe there is an error in Readme?

WesJD commented 10 months ago

According to the Maven Shade Documentation, <include> should be net/wesjd/anvilgui/**. Maybe there is an error in Readme?

Good catch. Please submit a PR fixing that if its true!

skylerush commented 10 months ago

the solution suggested by @joestr has indeed solved the issue.