Skip to content

Commit 55f7b67

Browse files
derklarodmulloy2
authored andcommitted
Update to junit 5, remove powermock
1 parent e44d1e6 commit 55f7b67

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1067
-1148
lines changed

pom.xml

Lines changed: 68 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.comphenix.protocol</groupId>
4+
<groupId>com.comphenix.protocol</groupId>
55
<artifactId>ProtocolLib</artifactId>
66
<name>ProtocolLib</name>
77
<version>4.8.0-SNAPSHOT</version>
@@ -16,7 +16,9 @@
1616
<project.build.number></project.build.number>
1717
<project.fullVersion>${project.version}</project.fullVersion>
1818

19-
<powermock.version>2.0.9</powermock.version>
19+
<junit.version>5.8.2</junit.version>
20+
<mockito.version>4.3.1</mockito.version>
21+
<netty.version>4.1.74.Final</netty.version>
2022
<spigot.version>1.18.1-R0.1-SNAPSHOT</spigot.version>
2123
</properties>
2224

@@ -71,7 +73,7 @@
7173

7274
<plugin>
7375
<artifactId>maven-compiler-plugin</artifactId>
74-
<version>3.8.1</version>
76+
<version>3.10.0</version>
7577
<configuration>
7678
<source>1.8</source>
7779
<target>1.8</target>
@@ -81,7 +83,7 @@
8183
<plugin>
8284
<groupId>org.apache.maven.plugins</groupId>
8385
<artifactId>maven-jar-plugin</artifactId>
84-
<version>3.2.0</version>
86+
<version>3.2.2</version>
8587
<configuration>
8688
<archive>
8789
<manifestEntries>
@@ -99,6 +101,14 @@
99101
<groupId>org.apache.maven.plugins</groupId>
100102
<artifactId>maven-surefire-plugin</artifactId>
101103
<version>3.0.0-M5</version>
104+
<dependencies>
105+
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
106+
<dependency>
107+
<groupId>org.junit.jupiter</groupId>
108+
<artifactId>junit-jupiter-engine</artifactId>
109+
<version>${junit.version}</version>
110+
</dependency>
111+
</dependencies>
102112
<configuration>
103113
<trimStackTrace>false</trimStackTrace>
104114
<useFile>false</useFile>
@@ -108,22 +118,22 @@
108118
<value>${project.version}</value>
109119
</property>
110120
</systemProperties>
111-
<!-- TODO figure out a better way to do this before Java 17 -->
112-
<!-- We're currently waiting on powermock, but we may need to switch -->
113-
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.regex=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED</argLine>
121+
<!-- We need this as we use reflection in tests to ensure equality -->
122+
<argLine>--add-opens java.base/java.util=ALL-UNNAMED</argLine>
114123
</configuration>
115124
</plugin>
116125

117126
<plugin>
118127
<artifactId>maven-javadoc-plugin</artifactId>
119-
<version>3.3.1</version>
128+
<version>3.3.2</version>
120129
<configuration>
121130
<failOnError>false</failOnError>
122131
<encoding>ISO-8859-1</encoding>
123132
<doctitle>ProtocolLib JavaDocs</doctitle>
124133
<windowtitle>ProtocolLib JavaDocs</windowtitle>
125134
<bottom>Copyright &#169; {inceptionYear}&#x2013;{currentYear}
126-
Comphenix and dmulloy2. Licensed under the GNU GPL v2.</bottom>
135+
Comphenix and dmulloy2. Licensed under the GNU GPL v2.
136+
</bottom>
127137
<additionalOptions>
128138
<additionalOption>-Xdoclint:none</additionalOption>
129139
</additionalOptions>
@@ -185,7 +195,7 @@
185195
<plugin>
186196
<groupId>org.apache.maven.plugins</groupId>
187197
<artifactId>maven-javadoc-plugin</artifactId>
188-
<version>3.2.0</version>
198+
<version>3.3.2</version>
189199
<executions>
190200
<execution>
191201
<id>attach-javadocs</id>
@@ -227,7 +237,7 @@
227237
<licenses>
228238
<license>
229239
<name>GNU GENERAL PUBLIC LICENSE - Version 2, June 1991</name>
230-
<url>http://www.gnu.org/licenses/gpl-2.0.txt</url>
240+
<url>https://www.gnu.org/licenses/gpl-2.0.txt</url>
231241
<distribution>repo</distribution>
232242
</license>
233243
</licenses>
@@ -236,7 +246,7 @@
236246
<developer>
237247
<id>dmulloy2</id>
238248
<name>Dan Mulloy</name>
239-
<url>http://dmulloy2.net/</url>
249+
<url>https://dmulloy2.net/</url>
240250
<roles>
241251
<role>developer</role>
242252
<role>maintainer</role>
@@ -246,7 +256,7 @@
246256
<id>aadnk</id>
247257
<name>Kristian S. Stangeland</name>
248258
<email>[email protected]</email>
249-
<url>http://comphenix.net/</url>
259+
<url>https://comphenix.net/</url>
250260
<roles>
251261
<role>former author</role>
252262
</roles>
@@ -277,38 +287,41 @@
277287
</repositories>
278288

279289
<dependencies>
280-
<!-- Compile with the old version of Netty for backwards compat -->
281-
<dependency>
282-
<groupId>io.netty</groupId>
283-
<artifactId>netty-all</artifactId>
284-
<version>4.0.23.Final</version>
285-
<scope>provided</scope>
286-
</dependency>
287-
<!-- since 1.18 minecraft uses new features of netty but netty is no longer bundled - make sure the new classes are available -->
288-
<dependency>
289-
<groupId>io.netty</groupId>
290-
<artifactId>netty-common</artifactId>
291-
<version>4.1.70.Final</version>
292-
<scope>test</scope>
293-
</dependency>
294-
<dependency>
295-
<groupId>io.netty</groupId>
296-
<artifactId>netty-transport</artifactId>
297-
<version>4.1.70.Final</version>
298-
<scope>test</scope>
299-
</dependency>
290+
<!-- core minecraft dependencies -->
300291
<dependency>
301292
<groupId>org.spigotmc</groupId>
302293
<artifactId>spigot-api</artifactId>
303294
<version>${spigot.version}</version>
304295
<scope>provided</scope>
296+
<exclusions>
297+
<exclusion>
298+
<groupId>junit</groupId>
299+
<artifactId>*</artifactId>
300+
</exclusion>
301+
</exclusions>
305302
</dependency>
306303
<dependency>
307304
<groupId>org.spigotmc</groupId>
308305
<artifactId>spigot</artifactId>
309306
<version>${spigot.version}</version>
310307
<scope>provided</scope>
308+
<exclusions>
309+
<exclusion>
310+
<groupId>junit</groupId>
311+
<artifactId>*</artifactId>
312+
</exclusion>
313+
</exclusions>
311314
</dependency>
315+
316+
<!-- Compile with the old version of Netty for backwards compat -->
317+
<!-- https://mvnrepository.com/artifact/io.netty/netty-all -->
318+
<dependency>
319+
<groupId>io.netty</groupId>
320+
<artifactId>netty-all</artifactId>
321+
<version>4.0.23.Final</version>
322+
<scope>provided</scope>
323+
</dependency>
324+
<!-- https://mvnrepository.com/artifact/net.kyori/adventure-text-serializer-gson -->
312325
<dependency>
313326
<groupId>net.kyori</groupId>
314327
<artifactId>adventure-text-serializer-gson</artifactId>
@@ -319,32 +332,43 @@
319332
<dependency>
320333
<groupId>net.bytebuddy</groupId>
321334
<artifactId>byte-buddy</artifactId>
322-
<version>1.12.3</version>
335+
<version>1.12.8</version>
323336
</dependency>
324337

325338
<!-- Testing dependencies -->
339+
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
326340
<dependency>
327-
<groupId>junit</groupId>
328-
<artifactId>junit</artifactId>
329-
<version>4.13.2</version>
341+
<groupId>org.junit.jupiter</groupId>
342+
<artifactId>junit-jupiter-api</artifactId>
343+
<version>${junit.version}</version>
330344
<scope>test</scope>
331345
</dependency>
346+
<!-- https://mvnrepository.com/artifact/org.mockito/mockito-core -->
332347
<dependency>
333348
<groupId>org.mockito</groupId>
334349
<artifactId>mockito-core</artifactId>
335-
<version>3.12.4</version>
350+
<version>${mockito.version}</version>
336351
<scope>test</scope>
337352
</dependency>
353+
<!-- https://mvnrepository.com/artifact/org.mockito/mockito-inline -->
338354
<dependency>
339-
<groupId>org.powermock</groupId>
340-
<artifactId>powermock-module-junit4</artifactId>
341-
<version>${powermock.version}</version>
355+
<groupId>org.mockito</groupId>
356+
<artifactId>mockito-inline</artifactId>
357+
<version>${mockito.version}</version>
358+
<scope>test</scope>
359+
</dependency>
360+
<!-- https://mvnrepository.com/artifact/io.netty/netty-common -->
361+
<dependency>
362+
<groupId>io.netty</groupId>
363+
<artifactId>netty-common</artifactId>
364+
<version>${netty.version}</version>
342365
<scope>test</scope>
343366
</dependency>
367+
<!-- https://mvnrepository.com/artifact/io.netty/netty-transport -->
344368
<dependency>
345-
<groupId>org.powermock</groupId>
346-
<artifactId>powermock-api-mockito2</artifactId>
347-
<version>${powermock.version}</version>
369+
<groupId>io.netty</groupId>
370+
<artifactId>netty-transport</artifactId>
371+
<version>${netty.version}</version>
348372
<scope>test</scope>
349373
</dependency>
350374
</dependencies>

0 commit comments

Comments
 (0)