Skip to content

Commit

Permalink
Update Maven Plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
CryptoMorin committed Jun 8, 2024
1 parent 226e625 commit c43d7e1
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 38 deletions.
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ Having multiple developers work on the same issue will be just a waste of time a
You should also try not to make any PRs before support is added when a new Minecraft version comes out even
if it's unrelated to adding support for that version since your changes are likely to conflict with the update.

### Usage

This project uses Maven. So you'll have to use `mvn` commands.
In IntelliJ, you can press `Ctrl` twice for the command window to popup.
To compile the library into `target` folder, you can use this Maven command:
```maven
mvn package
```

To test the library using the latest Spigot server, you can use:

```maven
mvn clean package -Ptester,latest
```

> [!NOTE]
> The server files will be generated inside `target/tests` folder.\
> The common server settings used between tests are in `src/test/resources`
### Rules

* One of the main principles of XSeries is that each utility should be independent except the ones that cannot be
Expand Down
67 changes: 36 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@
<id>nms-repo</id>
<url>https://repo.codemc.org/repository/nms/</url>
</repository>
<!-- <repository>-->
<!-- &lt;!&ndash; Sometimes codemc's snapshots don't have the mojang packages. &ndash;&gt;-->
<!-- <id>minecraft-repo</id>-->
<!-- <url>https://libraries.minecraft.net/</url>-->
<!-- </repository>-->
<!-- <repository>-->
<!-- &lt;!&ndash; Sometimes codemc's snapshots don't have the mojang packages. &ndash;&gt;-->
<!-- <id>minecraft-repo</id>-->
<!-- <url>https://libraries.minecraft.net/</url>-->
<!-- </repository>-->
</repositories>

<properties>
Expand All @@ -75,20 +75,22 @@
<!-- 1.16.5-R0.1-SNAPSHOT -->
<!-- 1.17.1-R0.1-SNAPSHOT -->
<spigotVersion>1.20.6-R0.1-SNAPSHOT</spigotVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<dependencies>
<!-- <dependency>-->
<!-- <groupId>com.mojang</groupId>-->
<!-- <artifactId>authlib</artifactId>-->
<!-- <version>1.5.25</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jetbrains</groupId>-->
<!-- <artifactId>annotations</artifactId>-->
<!-- <version>24.1.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.mojang</groupId>-->
<!-- <artifactId>authlib</artifactId>-->
<!-- <version>1.5.25</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.jetbrains</groupId>-->
<!-- <artifactId>annotations</artifactId>-->
<!-- <version>24.1.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
Expand All @@ -105,7 +107,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.8.2</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -115,7 +117,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -128,12 +130,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.7.0</version>
<configuration>
<!--all,-missing-->
<doclint>none</doclint>
<release>8</release>
<excludePackageNames>com.cryptomorin.xseries.unused:com.cryptomorin.xseries.particles</excludePackageNames>
<excludePackageNames>com.cryptomorin.xseries.unused:com.cryptomorin.xseries.particles
</excludePackageNames>
<!-- Apparently this is needed because it's a bug with maven JavaDoc plugin not being able to find the exe by itself. -->
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
</configuration>
Expand All @@ -149,7 +152,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<version>3.2.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -163,7 +166,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<version>1.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -174,8 +177,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
<configuration>
<encoding>UTF-8</encoding>
<proc>none</proc>
<source>8</source>
<target>8</target>
Expand All @@ -197,24 +201,25 @@
<goal>testCompile</goal>
</goals>
<configuration>
<skip>true</skip>
<!-- <skip>true</skip>-->
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<version>3.2.5</version>
<configuration>
<!--<failIfNoTests>true</failIfNoTests>-->
<!-- <skipTests>true</skipTests>-->
<trimStackTrace>false</trimStackTrace>
<workingDirectory>${basedir}/target/tests</workingDirectory>
<!-- <dependenciesToScan>-->
<!-- <dependency>*:spigot:*:*:1.16.5-R0.1-SNAPSHOT</dependency>-->
<!-- </dependenciesToScan>-->
<!-- <dependenciesToScan>-->
<!-- <dependency>*:spigot:*:*:1.16.5-R0.1-SNAPSHOT</dependency>-->
<!-- </dependenciesToScan>-->
<includes>
<include>**/DummySpigot.java</include>
<include>**/*.java</include>
</includes>
</configuration>
</plugin>
Expand Down Expand Up @@ -245,7 +250,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
<configuration>
<source>21</source>
<target>21</target>
Expand All @@ -260,7 +265,7 @@
<configuration>
<skip>false</skip>
<testIncludes>
<include>*/**DummySpigot.java</include>
<include>**/*.java</include>
</testIncludes>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,6 @@ public static <T> VersionHandle<T> v(int version, T handle) {
}

/**
* Overload for {@link #v(int, T)} that supports patch versions
*
* @since 9.5.0
*/
public static <T> VersionHandle<T> v(int version, int patch, T handle) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

public interface PackageHandle {
@Language("RegExp")
String JAVA_PACKAGE_PATTERN = "(\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*\\.)+\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*";
String JAVA_PACKAGE_PATTERN = "(\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*\\.)*\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*";
@Language("RegExp")
String JAVA_IDENTIFIER_PATTERN = "\\p{javaJavaIdentifierStart}\\p{javaJavaIdentifierPart}*";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public static Object getConnection(@Nonnull Player player) {
*
* @param player the player to send the packet to.
* @param packets the packets to send.
* @return the async thread handling the packet.
* @since 1.0.0
*/
@Nonnull
Expand Down
4 changes: 2 additions & 2 deletions src/test/DummySpigot.java → src/test/DummySpigotTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class DummySpigot extends DummyAbstractServer implements InvocationHandler {
public class DummySpigotTest extends DummyAbstractServer implements InvocationHandler {
@Override
protected InvocationHandler main() {
return new DummySpigot();
return new DummySpigotTest();
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/TinyReflection.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public final class TinyReflection {
static {
String version = null;
try {
version = Files.readAllLines(Paths.get(DummySpigot.class.getResource("version.txt").toURI())).get(0);
version = Files.readAllLines(Paths.get(DummySpigotTest.class.getResource("version.txt").toURI())).get(0);
} catch (IOException | URISyntaxException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit c43d7e1

Please sign in to comment.