Skip to content

Commit c43d7e1

Browse files
committed
Update Maven Plugins
1 parent 226e625 commit c43d7e1

File tree

7 files changed

+59
-38
lines changed

7 files changed

+59
-38
lines changed

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,25 @@ Having multiple developers work on the same issue will be just a waste of time a
1414
You should also try not to make any PRs before support is added when a new Minecraft version comes out even
1515
if it's unrelated to adding support for that version since your changes are likely to conflict with the update.
1616

17+
### Usage
18+
19+
This project uses Maven. So you'll have to use `mvn` commands.
20+
In IntelliJ, you can press `Ctrl` twice for the command window to popup.
21+
To compile the library into `target` folder, you can use this Maven command:
22+
```maven
23+
mvn package
24+
```
25+
26+
To test the library using the latest Spigot server, you can use:
27+
28+
```maven
29+
mvn clean package -Ptester,latest
30+
```
31+
32+
> [!NOTE]
33+
> The server files will be generated inside `target/tests` folder.\
34+
> The common server settings used between tests are in `src/test/resources`
35+
1736
### Rules
1837

1938
* One of the main principles of XSeries is that each utility should be independent except the ones that cannot be

pom.xml

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@
6060
<id>nms-repo</id>
6161
<url>https://repo.codemc.org/repository/nms/</url>
6262
</repository>
63-
<!-- <repository>-->
64-
<!-- &lt;!&ndash; Sometimes codemc's snapshots don't have the mojang packages. &ndash;&gt;-->
65-
<!-- <id>minecraft-repo</id>-->
66-
<!-- <url>https://libraries.minecraft.net/</url>-->
67-
<!-- </repository>-->
63+
<!-- <repository>-->
64+
<!-- &lt;!&ndash; Sometimes codemc's snapshots don't have the mojang packages. &ndash;&gt;-->
65+
<!-- <id>minecraft-repo</id>-->
66+
<!-- <url>https://libraries.minecraft.net/</url>-->
67+
<!-- </repository>-->
6868
</repositories>
6969

7070
<properties>
@@ -75,20 +75,22 @@
7575
<!-- 1.16.5-R0.1-SNAPSHOT -->
7676
<!-- 1.17.1-R0.1-SNAPSHOT -->
7777
<spigotVersion>1.20.6-R0.1-SNAPSHOT</spigotVersion>
78+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
79+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
7880
</properties>
7981

8082
<dependencies>
81-
<!-- <dependency>-->
82-
<!-- <groupId>com.mojang</groupId>-->
83-
<!-- <artifactId>authlib</artifactId>-->
84-
<!-- <version>1.5.25</version>-->
85-
<!-- <scope>provided</scope>-->
86-
<!-- </dependency>-->
87-
<!-- <dependency>-->
88-
<!-- <groupId>org.jetbrains</groupId>-->
89-
<!-- <artifactId>annotations</artifactId>-->
90-
<!-- <version>24.1.0</version>-->
91-
<!-- </dependency>-->
83+
<!-- <dependency>-->
84+
<!-- <groupId>com.mojang</groupId>-->
85+
<!-- <artifactId>authlib</artifactId>-->
86+
<!-- <version>1.5.25</version>-->
87+
<!-- <scope>provided</scope>-->
88+
<!-- </dependency>-->
89+
<!-- <dependency>-->
90+
<!-- <groupId>org.jetbrains</groupId>-->
91+
<!-- <artifactId>annotations</artifactId>-->
92+
<!-- <version>24.1.0</version>-->
93+
<!-- </dependency>-->
9294
<dependency>
9395
<groupId>org.spigotmc</groupId>
9496
<artifactId>spigot</artifactId>
@@ -105,7 +107,7 @@
105107
<dependency>
106108
<groupId>org.junit.jupiter</groupId>
107109
<artifactId>junit-jupiter</artifactId>
108-
<version>5.8.2</version>
110+
<version>5.10.2</version>
109111
<scope>test</scope>
110112
</dependency>
111113
</dependencies>
@@ -115,7 +117,7 @@
115117
<plugin>
116118
<groupId>org.apache.maven.plugins</groupId>
117119
<artifactId>maven-source-plugin</artifactId>
118-
<version>3.2.0</version>
120+
<version>3.3.1</version>
119121
<executions>
120122
<execution>
121123
<id>attach-sources</id>
@@ -128,12 +130,13 @@
128130
<plugin>
129131
<groupId>org.apache.maven.plugins</groupId>
130132
<artifactId>maven-javadoc-plugin</artifactId>
131-
<version>3.2.0</version>
133+
<version>3.7.0</version>
132134
<configuration>
133135
<!--all,-missing-->
134136
<doclint>none</doclint>
135137
<release>8</release>
136-
<excludePackageNames>com.cryptomorin.xseries.unused:com.cryptomorin.xseries.particles</excludePackageNames>
138+
<excludePackageNames>com.cryptomorin.xseries.unused:com.cryptomorin.xseries.particles
139+
</excludePackageNames>
137140
<!-- Apparently this is needed because it's a bug with maven JavaDoc plugin not being able to find the exe by itself. -->
138141
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
139142
</configuration>
@@ -149,7 +152,7 @@
149152
<plugin>
150153
<groupId>org.apache.maven.plugins</groupId>
151154
<artifactId>maven-gpg-plugin</artifactId>
152-
<version>1.6</version>
155+
<version>3.2.4</version>
153156
<executions>
154157
<execution>
155158
<id>sign-artifacts</id>
@@ -163,7 +166,7 @@
163166
<plugin>
164167
<groupId>org.sonatype.plugins</groupId>
165168
<artifactId>nexus-staging-maven-plugin</artifactId>
166-
<version>1.6.8</version>
169+
<version>1.7.0</version>
167170
<extensions>true</extensions>
168171
<configuration>
169172
<serverId>ossrh</serverId>
@@ -174,8 +177,9 @@
174177
<plugin>
175178
<groupId>org.apache.maven.plugins</groupId>
176179
<artifactId>maven-compiler-plugin</artifactId>
177-
<version>3.8.1</version>
180+
<version>3.13.0</version>
178181
<configuration>
182+
<encoding>UTF-8</encoding>
179183
<proc>none</proc>
180184
<source>8</source>
181185
<target>8</target>
@@ -197,24 +201,25 @@
197201
<goal>testCompile</goal>
198202
</goals>
199203
<configuration>
200-
<skip>true</skip>
204+
<!-- <skip>true</skip>-->
201205
</configuration>
202206
</execution>
203207
</executions>
204208
</plugin>
205209
<plugin>
206210
<groupId>org.apache.maven.plugins</groupId>
207211
<artifactId>maven-surefire-plugin</artifactId>
208-
<version>3.0.0-M5</version>
212+
<version>3.2.5</version>
209213
<configuration>
210214
<!--<failIfNoTests>true</failIfNoTests>-->
215+
<!-- <skipTests>true</skipTests>-->
211216
<trimStackTrace>false</trimStackTrace>
212217
<workingDirectory>${basedir}/target/tests</workingDirectory>
213-
<!-- <dependenciesToScan>-->
214-
<!-- <dependency>*:spigot:*:*:1.16.5-R0.1-SNAPSHOT</dependency>-->
215-
<!-- </dependenciesToScan>-->
218+
<!-- <dependenciesToScan>-->
219+
<!-- <dependency>*:spigot:*:*:1.16.5-R0.1-SNAPSHOT</dependency>-->
220+
<!-- </dependenciesToScan>-->
216221
<includes>
217-
<include>**/DummySpigot.java</include>
222+
<include>**/*.java</include>
218223
</includes>
219224
</configuration>
220225
</plugin>
@@ -245,7 +250,7 @@
245250
<plugin>
246251
<groupId>org.apache.maven.plugins</groupId>
247252
<artifactId>maven-compiler-plugin</artifactId>
248-
<version>3.8.1</version>
253+
<version>3.13.0</version>
249254
<configuration>
250255
<source>21</source>
251256
<target>21</target>
@@ -260,7 +265,7 @@
260265
<configuration>
261266
<skip>false</skip>
262267
<testIncludes>
263-
<include>*/**DummySpigot.java</include>
268+
<include>**/*.java</include>
264269
</testIncludes>
265270
</configuration>
266271
</execution>

src/main/java/com/cryptomorin/xseries/reflection/XReflection.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@ public static <T> VersionHandle<T> v(int version, T handle) {
274274
}
275275

276276
/**
277-
* Overload for {@link #v(int, T)} that supports patch versions
278-
*
279277
* @since 9.5.0
280278
*/
281279
public static <T> VersionHandle<T> v(int version, int patch, T handle) {

src/main/java/com/cryptomorin/xseries/reflection/jvm/classes/PackageHandle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
public interface PackageHandle {
66
@Language("RegExp")
7-
String JAVA_PACKAGE_PATTERN = "(\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*\\.)+\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*";
7+
String JAVA_PACKAGE_PATTERN = "(\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*\\.)*\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*";
88
@Language("RegExp")
99
String JAVA_IDENTIFIER_PATTERN = "\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*";
1010

src/main/java/com/cryptomorin/xseries/reflection/minecraft/MinecraftConnection.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public static Object getConnection(@Nonnull Player player) {
9191
*
9292
* @param player the player to send the packet to.
9393
* @param packets the packets to send.
94-
* @return the async thread handling the packet.
9594
* @since 1.0.0
9695
*/
9796
@Nonnull

src/test/DummySpigot.java renamed to src/test/DummySpigotTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
import java.lang.reflect.InvocationHandler;
44
import java.lang.reflect.Method;
55

6-
public class DummySpigot extends DummyAbstractServer implements InvocationHandler {
6+
public class DummySpigotTest extends DummyAbstractServer implements InvocationHandler {
77
@Override
88
protected InvocationHandler main() {
9-
return new DummySpigot();
9+
return new DummySpigotTest();
1010
}
1111

1212
@Test

src/test/TinyReflection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public final class TinyReflection {
2323
static {
2424
String version = null;
2525
try {
26-
version = Files.readAllLines(Paths.get(DummySpigot.class.getResource("version.txt").toURI())).get(0);
26+
version = Files.readAllLines(Paths.get(DummySpigotTest.class.getResource("version.txt").toURI())).get(0);
2727
} catch (IOException | URISyntaxException e) {
2828
e.printStackTrace();
2929
}

0 commit comments

Comments
 (0)