Skip to content

Commit 8a049ee

Browse files
committed
Refactor pom.xml to use maven-antrun-plugin for file copying and update README.md with new JavaDocs link and explanation on Mojang and Spigot maps separation
1 parent 5c66ad9 commit 8a049ee

File tree

4 files changed

+19
-29
lines changed

4 files changed

+19
-29
lines changed

.mvn-exec/CopyFile.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

.mvn-exec/RemoveMetaInf.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

FastNbt-jar/pom.xml

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,38 +24,24 @@
2424
<build>
2525
<plugins>
2626
<plugin>
27-
<groupId>org.codehaus.mojo</groupId>
28-
<artifactId>exec-maven-plugin</artifactId>
27+
<groupId>org.apache.maven.plugins</groupId>
28+
<artifactId>maven-antrun-plugin</artifactId>
2929
<version>3.1.0</version>
3030
<executions>
3131
<execution>
32-
<id>RemoveMetaInf</id>
3332
<phase>package</phase>
3433
<configuration>
35-
<executable>cmd</executable>
36-
<workingDirectory>${project.parent.basedir}</workingDirectory>
37-
<arguments>
38-
<argument>/C</argument>
39-
<argument>.mvn-exec\RemoveMetaInf.bat</argument>
40-
</arguments>
34+
<target>
35+
<!-- Copy JAR to multiple directories -->
36+
<copy file="${basedir}/../output/${project.parent.artifactId}.jar" todir="C:/Progetti/Minecraft/TestServer/1.20/plugins/"/>
37+
<copy file="${basedir}/../output/${project.parent.artifactId}.jar" todir="C:/Progetti/Minecraft/TestServer/1.20.6/plugins/"/>
38+
<copy file="${basedir}/../output/${project.parent.artifactId}.jar" todir="C:/Progetti/Minecraft/TestServer/1.21.1/plugins/"/>
39+
<copy file="${basedir}/../output/${project.parent.artifactId}.jar" todir="C:/Progetti/Minecraft/TestServer/1.21.3/plugins/"/>
40+
<copy file="${basedir}/../output/${project.parent.artifactId}.jar" todir="C:/Progetti/Minecraft/TestServer/1.21.4/plugins/"/>
41+
</target>
4142
</configuration>
4243
<goals>
43-
<goal>exec</goal>
44-
</goals>
45-
</execution>
46-
<execution>
47-
<id>CopyFile</id>
48-
<phase>package</phase>
49-
<configuration>
50-
<executable>cmd</executable>
51-
<workingDirectory>${project.parent.basedir}</workingDirectory>
52-
<arguments>
53-
<argument>/C</argument>
54-
<argument>.mvn-exec\CopyFile.bat</argument>
55-
</arguments>
56-
</configuration>
57-
<goals>
58-
<goal>exec</goal>
44+
<goal>run</goal>
5945
</goals>
6046
</execution>
6147
</executions>

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# FastNBT
22
<hr>
33
<h3 align="center">
4-
<a href="https://lonedev6.github.io/FastNBT/">☕ JavaDocs</a>
4+
<a href="https://lonedev6.github.io/FastNBT/beer/devs/fastnbt/nms/nbt/package-summary.html">☕ JavaDocs</a>
55
</h3>
66
<hr>
77

@@ -122,6 +122,12 @@ libraries:
122122

123123
Should be all.
124124

125+
126+
## Why the Mojang and Spigot maps are separated?
127+
Paper user Mojang mapped JAR. At the same time Paper itself remaps the plugins JARs at runtime, thinking that they
128+
all are Spigot mapped. This causes issues because it remaps the already remapped classes.
129+
This is the only solution I found to avoid this issue, in the future I might come up with something else.
130+
125131
# LoneDev's Notes
126132

127133
## How to publish to the maven repository
@@ -132,7 +138,7 @@ Should be all.
132138

133139
## Editing to the repository
134140
- Clone it
135-
- Change paths in `.mvn-exec/CopyFile.bat` and `RemoveMetaInf.bat` based on your directories
141+
- Change paths in `pom.xml` -> `maven-antrun-plugin` based on your directories, or comment the plugin if you don't need it
136142
- Make your changes
137143
- Run `mvn install` in order to access the plugin as dependency in your projects
138144
- Run Maven `clean package` and get the generated jar from `output` folder

0 commit comments

Comments
 (0)