Skip to content

Commit eebcfe8

Browse files
author
Corby Page
authored
Update to Java 21 (#188)
* Setting maven.compiler.release to 21 * Updating nexus staging maven plugin * Updated source/Javadoc plugin
1 parent 8e2ba62 commit eebcfe8

File tree

6 files changed

+92
-25
lines changed

6 files changed

+92
-25
lines changed

pom.xml

+63-21
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>
44

5-
<parent>
6-
<groupId>org.sonatype.oss</groupId>
7-
<artifactId>oss-parent</artifactId>
8-
<version>7</version>
9-
</parent>
10-
115
<groupId>org.skyscreamer</groupId>
126
<artifactId>jsonassert</artifactId>
13-
<version>1.5.2-SNAPSHOT</version>
7+
<version>1.5.2</version>
148
<packaging>jar</packaging>
159

1610
<name>JSONassert</name>
1711
<description>A library to develop RESTful but flexible APIs</description>
1812
<url>https://github.com/skyscreamer/JSONassert</url>
1913

14+
<properties>
15+
<maven.compiler.release>21</maven.compiler.release>
16+
</properties>
17+
2018
<licenses>
2119
<license>
2220
<name>The Apache Software License, Version 2.0</name>
@@ -60,32 +58,72 @@
6058
<version>4.13.2</version>
6159
<scope>test</scope>
6260
</dependency>
61+
<dependency>
62+
<groupId>org.hamcrest</groupId>
63+
<artifactId>hamcrest</artifactId>
64+
<version>2.2</version>
65+
<scope>test</scope>
66+
</dependency>
6367
</dependencies>
6468

6569
<build>
6670
<plugins>
6771
<plugin>
6872
<groupId>org.apache.maven.plugins</groupId>
6973
<artifactId>maven-compiler-plugin</artifactId>
70-
<version>2.3.1</version>
71-
<configuration>
72-
<source>1.8</source>
73-
<target>1.8</target>
74-
</configuration>
74+
<version>3.11.0</version>
7575
</plugin>
7676
<plugin>
7777
<groupId>org.apache.maven.plugins</groupId>
7878
<artifactId>maven-site-plugin</artifactId>
79-
<version>3.10.0</version>
79+
</plugin>
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-source-plugin</artifactId>
83+
<version>2.2.1</version>
84+
<executions>
85+
<execution>
86+
<id>attach-sources</id>
87+
<goals>
88+
<goal>jar-no-fork</goal>
89+
</goals>
90+
</execution>
91+
</executions>
92+
</plugin>
93+
<plugin>
94+
<groupId>org.apache.maven.plugins</groupId>
95+
<artifactId>maven-javadoc-plugin</artifactId>
96+
<version>2.9.1</version>
97+
<executions>
98+
<execution>
99+
<id>attach-javadocs</id>
100+
<goals>
101+
<goal>jar</goal>
102+
</goals>
103+
</execution>
104+
</executions>
105+
<configuration>
106+
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
107+
<source>8</source>
108+
</configuration>
109+
</plugin>
110+
<plugin>
111+
<groupId>org.sonatype.plugins</groupId>
112+
<artifactId>nexus-staging-maven-plugin</artifactId>
113+
<version>1.6.7</version>
114+
<extensions>true</extensions>
80115
<configuration>
81-
<reportPlugins>
82-
<plugin>
83-
<groupId>org.codehaus.mojo</groupId>
84-
<artifactId>cobertura-maven-plugin</artifactId>
85-
<version>2.7</version>
86-
</plugin>
87-
</reportPlugins>
116+
<serverId>ossrh</serverId>
117+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
118+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
88119
</configuration>
120+
<dependencies>
121+
<dependency>
122+
<groupId>com.thoughtworks.xstream</groupId>
123+
<artifactId>xstream</artifactId>
124+
<version>1.4.15</version> <!-- apparently this needs to be exactly this version -->
125+
</dependency>
126+
</dependencies>
89127
</plugin>
90128
</plugins>
91129
<extensions>
@@ -112,6 +150,10 @@
112150
<id>github-project-site</id>
113151
<url>gitsite:[email protected]/skyscreamer/JSONassert.git</url>
114152
</site>
153+
<snapshotRepository>
154+
<id>ossrh</id>
155+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
156+
</snapshotRepository>
115157
</distributionManagement>
116158

117159
<profiles>
@@ -128,7 +170,7 @@
128170
<plugin>
129171
<groupId>org.apache.maven.plugins</groupId>
130172
<artifactId>maven-gpg-plugin</artifactId>
131-
<version>3.0.1</version>
173+
<version>1.5</version>
132174
<executions>
133175
<execution>
134176
<id>sign-artifacts</id>

src/main/java/org/skyscreamer/jsonassert/ArrayValueMatcher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
* <p>To simplify complexity of expected JSON string, the value <code>"{a:[[9]]}"</code> may be replaced by <code>"{a:[9]}"</code> or <code>"{a:9}"</code></p>
134134
*
135135
* @author Duncan Mackinder
136-
*
136+
* @param <T> Array Type
137137
*/
138138
public class ArrayValueMatcher<T> implements LocationAwareValueMatcher<T> {
139139
private final JSONComparator comparator;

src/main/java/org/skyscreamer/jsonassert/JSONCompareMode.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
* <p>These different modes define different behavior for the comparison of JSON for testing.
1919
* Each mode encapsulates two underlying behaviors: extensibility and strict ordering.</p>
2020
*
21-
* <table border="1" summary="Behavior of JSONCompareMode">
21+
* <table border="1">
22+
* <caption>
23+
* Behavior of JSONCompareMode
24+
* </caption>
2225
* <tr><th>&nbsp;</th><th>Extensible</th><th>Strict Ordering</th></tr>
2326
* <tr><th>STRICT</th><th>no</th><th>yes</th></tr>
2427
* <tr><th>LENIENT</th><th>yes</th><th>no</th></tr>

src/main/java/org/skyscreamer/jsonassert/LocationAwareValueMatcher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* A ValueMatcher extension that provides location in form of prefix to the equals method.
2222
*
2323
* @author Duncan Mackinder
24-
*
24+
* @param <T> Generic Type
2525
*/
2626
public interface LocationAwareValueMatcher<T> extends ValueMatcher<T> {
2727

src/main/java/org/skyscreamer/jsonassert/RegularExpressionValueMatcher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* specify regular expression pattern that actual value must match.
2929
*
3030
* @author Duncan Mackinder
31-
*
31+
* @param <T> Generic Type
3232
*/
3333
public class RegularExpressionValueMatcher<T> implements ValueMatcher<T> {
3434

src/main/java/org/skyscreamer/jsonassert/comparator/AbstractComparator.java

+22
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,17 @@
2626
/**
2727
* This class provides a skeletal implementation of the {@link JSONComparator}
2828
* interface, to minimize the effort required to implement this interface.
29+
*
30+
*
2931
*/
3032
public abstract class AbstractComparator implements JSONComparator {
3133

34+
/**
35+
* Default constructor
36+
*/
37+
public AbstractComparator() {
38+
}
39+
3240
/**
3341
* Compares JSONObject provided to the expected JSONObject, and returns the results of the comparison.
3442
*
@@ -57,6 +65,12 @@ public final JSONCompareResult compareJSON(JSONArray expected, JSONArray actual)
5765
return result;
5866
}
5967

68+
/**
69+
* @param prefix
70+
* @param expected
71+
* @param actual
72+
* @param result
73+
*/
6074
protected void checkJsonObjectKeysActualInExpected(String prefix, JSONObject expected, JSONObject actual, JSONCompareResult result) {
6175
Set<String> actualKeys = getKeys(actual);
6276
for (String key : actualKeys) {
@@ -66,6 +80,14 @@ protected void checkJsonObjectKeysActualInExpected(String prefix, JSONObject exp
6680
}
6781
}
6882

83+
/**
84+
*
85+
* @param prefix
86+
* @param expected
87+
* @param actual
88+
* @param result
89+
* @throws JSONException
90+
*/
6991
protected void checkJsonObjectKeysExpectedInActual(String prefix, JSONObject expected, JSONObject actual, JSONCompareResult result) throws JSONException {
7092
Set<String> expectedKeys = getKeys(expected);
7193
for (String key : expectedKeys) {

0 commit comments

Comments
 (0)