Skip to content

Commit

Permalink
Merge pull request #3836 from edalex-ian/chore/upgrade-jackson
Browse files Browse the repository at this point in the history
chore(deps): upgrade jackson
  • Loading branch information
edalex-ian authored Feb 16, 2022
2 parents 30d3980 + 96b1192 commit 22a891f
Show file tree
Hide file tree
Showing 52 changed files with 610 additions and 668 deletions.
17 changes: 0 additions & 17 deletions Source/Plugins/Admin/com.tle.web.adminconsole/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,3 @@ lazy val adminConsoleJar = project in file("jarsrc")
IO copyFile (jarFile, outJar)
Seq(outJar)
}.taskValue

(assembly / assemblyMergeStrategy) := {
// Post SpringHib5 upgrade, the following error was thrown on build:
// deduplicate: different file contents found in the following:
// [error] .../com.fasterxml/classmate/bundles/classmate-1.5.1.jar:module-info.class
// [error] .../com.sun.istack/istack-commons-runtime/jars/istack-commons-runtime-3.0.7.jar:module-info.class
// [error] .../com.sun.xml.fastinfoset/FastInfoset/jars/FastInfoset-1.2.15.jar:module-info.class
// [error] .../javax.xml.bind/jaxb-api/jars/jaxb-api-2.3.1.jar:module-info.class
// [error] .../org.glassfish.jaxb/jaxb-runtime/jars/jaxb-runtime-2.3.1.jar:module-info.class
// [error] .../org.glassfish.jaxb/txw2/jars/txw2-2.3.1.jar:module-info.class
// [error] .../org.jvnet.staxex/stax-ex/jars/stax-ex-1.8.jar:module-info.class
// As per https://stackoverflow.com/questions/54834125/sbt-assembly-deduplicate-module-info-class , discarding is OK for Java 8
case "module-info.class" => MergeStrategy.discard
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
}
13 changes: 1 addition & 12 deletions Source/Plugins/Admin/com.tle.web.adminconsole/jarsrc/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,8 @@ excludeDependencies ++= Seq(
// org.springframework/spring-context/jars/spring-context-3.2.18.RELEASE.jar:overview.html
// org.springframework/spring-web/jars/spring-web-3.2.18.RELEASE.jar:overview.html
case x if x.contains("overview.html") => MergeStrategy.first
// Post SpringHib5 upgrade, the following error was thrown on build:
// deduplicate: different file contents found in the following:
// [error] .../com.fasterxml/classmate/bundles/classmate-1.5.1.jar:module-info.class
// [error] .../com.sun.istack/istack-commons-runtime/jars/istack-commons-runtime-3.0.7.jar:module-info.class
// [error] .../com.sun.xml.fastinfoset/FastInfoset/jars/FastInfoset-1.2.15.jar:module-info.class
// [error] .../javax.xml.bind/jaxb-api/jars/jaxb-api-2.3.1.jar:module-info.class
// [error] .../org.glassfish.jaxb/jaxb-runtime/jars/jaxb-runtime-2.3.1.jar:module-info.class
// [error] .../org.glassfish.jaxb/txw2/jars/txw2-2.3.1.jar:module-info.class
// [error] .../org.jvnet.staxex/stax-ex/jars/stax-ex-1.8.jar:module-info.class
// As per https://stackoverflow.com/questions/54834125/sbt-assembly-deduplicate-module-info-class , discarding is OK for Java 8
case "module-info.class" => MergeStrategy.discard
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
}
dependsOn(platformCommon, platformSwing, platformEquella, LocalProject("com_tle_webstart_admin"))
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,7 @@ dependsOn(platformSwing, LocalProject("com_tle_common_applet"))
// org.springframework/spring-context/jars/spring-context-3.2.18.RELEASE.jar:overview.html
// org.springframework/spring-web/jars/spring-web-3.2.18.RELEASE.jar:overview.html
case x if x.contains("overview.html") => MergeStrategy.first
// Post SpringHib5 upgrade, the following error was thrown on build:
// deduplicate: different file contents found in the following:
// [error] .../com.fasterxml/classmate/bundles/classmate-1.5.1.jar:module-info.class
// [error] .../com.sun.istack/istack-commons-runtime/jars/istack-commons-runtime-3.0.7.jar:module-info.class
// [error] .../com.sun.xml.fastinfoset/FastInfoset/jars/FastInfoset-1.2.15.jar:module-info.class
// [error] .../javax.xml.bind/jaxb-api/jars/jaxb-api-2.3.1.jar:module-info.class
// [error] .../org.glassfish.jaxb/jaxb-runtime/jars/jaxb-runtime-2.3.1.jar:module-info.class
// [error] .../org.glassfish.jaxb/txw2/jars/txw2-2.3.1.jar:module-info.class
// [error] .../org.jvnet.staxex/stax-ex/jars/stax-ex-1.8.jar:module-info.class
// As per https://stackoverflow.com/questions/54834125/sbt-assembly-deduplicate-module-info-class , discarding is OK for Java 8
case "module-info.class" => MergeStrategy.discard
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
}
13 changes: 1 addition & 12 deletions Source/Plugins/Core/com.equella.core/jarsrc/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,8 @@ libraryDependencies ++= Seq(
// org.springframework/spring-context/jars/spring-context-3.2.18.RELEASE.jar:overview.html
// org.springframework/spring-web/jars/spring-web-3.2.18.RELEASE.jar:overview.html
case x if x.contains("overview.html") => MergeStrategy.first
// Post SpringHib5 upgrade, the following error was thrown on build:
// deduplicate: different file contents found in the following:
// [error] .../com.fasterxml/classmate/bundles/classmate-1.5.1.jar:module-info.class
// [error] .../com.sun.istack/istack-commons-runtime/jars/istack-commons-runtime-3.0.7.jar:module-info.class
// [error] .../com.sun.xml.fastinfoset/FastInfoset/jars/FastInfoset-1.2.15.jar:module-info.class
// [error] .../javax.xml.bind/jaxb-api/jars/jaxb-api-2.3.1.jar:module-info.class
// [error] .../org.glassfish.jaxb/jaxb-runtime/jars/jaxb-runtime-2.3.1.jar:module-info.class
// [error] .../org.glassfish.jaxb/txw2/jars/txw2-2.3.1.jar:module-info.class
// [error] .../org.jvnet.staxex/stax-ex/jars/stax-ex-1.8.jar:module-info.class
// As per https://stackoverflow.com/questions/54834125/sbt-assembly-deduplicate-module-info-class , discarding is OK for Java 8
case "module-info.class" => MergeStrategy.discard
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
}

Expand Down
11 changes: 1 addition & 10 deletions Source/Server/conversion/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ excludeDependencies += "commons-logging" % "commons-logging"
// Different blueprint.handlers may specify different classes. Using the first one allows testing to pass.
case PathList("META-INF", "blueprint.handlers") => MergeStrategy.first

// OK to do in Java 8 - interesting that the global case for module-info.class didn't pick up the bouncy castle files
// deduplicate: different file contents found in the following:
// .../org.bouncycastle/bcmail-jdk15on/jars/bcmail-jdk15on-1.65.jar:META-INF/versions/9/module-info.class
// .../org.bouncycastle/bcpkix-jdk15on/jars/bcpkix-jdk15on-1.65.jar:META-INF/versions/9/module-info.class
// .../org.bouncycastle/bcprov-jdk15on/jars/bcprov-jdk15on-1.65.jar:META-INF/versions/9/module-info.class
case PathList("META-INF", "versions", "9", "module-info.class") => MergeStrategy.first

// The idea is to keep the later suffix list.
// Due to the error: deduplicate: different file contents found in the following:
// ...
Expand All @@ -41,10 +34,8 @@ excludeDependencies += "commons-logging" % "commons-logging"
// ...
case PathList("mozilla", "public-suffix-list.txt") => MergeStrategy.last

// OK to do in Java 8
case "module-info.class" => MergeStrategy.discard
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
}

Expand Down
12 changes: 1 addition & 11 deletions Source/Server/equellaserver/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,6 @@ run := {
// Different blueprint.handlers may specify different classes. Using the first one allows testing to pass.
case PathList("META-INF", "blueprint.handlers") => MergeStrategy.first

// OK to do in Java 8 - interesting that the global case for module-info.class didn't pick up the bouncy castle files
// deduplicate: different file contents found in the following:
// .../io.github.classgraph/classgraph/jars/classgraph-4.8.87.jar:META-INF/versions/9/module-info.class
// .../org.bouncycastle/bcmail-jdk15on/jars/bcmail-jdk15on-1.65.jar:META-INF/versions/9/module-info.class
// .../org.bouncycastle/bcpkix-jdk15on/jars/bcpkix-jdk15on-1.65.jar:META-INF/versions/9/module-info.class
// .../org.bouncycastle/bcprov-jdk15on/jars/bcprov-jdk15on-1.65.jar:META-INF/versions/9/module-info.class
case PathList("META-INF", "versions", "9", "module-info.class") => MergeStrategy.first

// Curious that it's xml vs soap. testing passes using the first one.
// Due to the error: deduplicate: different file contents found in the following:
// ...
Expand All @@ -428,10 +420,8 @@ run := {
// ...
case PathList("META-INF", "cxf", "java2wsbeans.xml") => MergeStrategy.first

// Safe to do at least in JDK 8
case "module-info.class" => MergeStrategy.discard
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
}

Expand Down
8 changes: 0 additions & 8 deletions Source/Tools/UpgradeInstallation/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ excludeDependencies ++= Seq(
(assembly / mainClass) := Some("com.tle.upgrade.UpgradeMain")
(assembly / assemblyOption) := (assembly / assemblyOption).value.withIncludeScala(true)

(assembly / assemblyMergeStrategy) := {
case PathList("org", "xmlpull", "v1", _*) => MergeStrategy.first
case "module-info.class" => MergeStrategy.discard
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
}

val upgradeManager = LocalProject("UpgradeManager")

(Compile / resourceGenerators) += Def.task {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.tle.webtests.bugs;

import com.fasterxml.jackson.databind.JsonNode;
import com.tle.common.Pair;
import com.tle.webtests.pageobject.ErrorPage;
import com.tle.webtests.pageobject.oauth.OAuthDefaultRedirectPage;
Expand All @@ -11,14 +12,14 @@
import com.tle.webtests.test.webservices.rest.OAuthClient;
import com.tle.webtests.test.webservices.rest.OAuthUtils;
import java.io.IOException;
import java.text.ParseException;
import java.util.List;
import java.util.UUID;
import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.message.BasicHeader;
import org.codehaus.jackson.JsonNode;
import org.testng.Assert;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -83,7 +84,7 @@ private void assertNoCookies() {
* @throws IOException
*/
@Test
public void testOAuthServerSideFlow() throws IllegalStateException, IOException {
public void testOAuthServerSideFlow() throws IllegalStateException, IOException, ParseException {
logon("AutoTest", "automated");
OAuthClient client = new OAuthClient();
client.setName(CLIENT_ID_SERVER_FLOW);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package com.tle.webtests.test.webservices.rest;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNull;

import com.dytech.devlib.PropBagEx;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.Lists;
import com.tle.webtests.pageobject.viewitem.ItemId;
import java.io.IOException;
Expand All @@ -17,9 +21,6 @@
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.entity.StringEntity;
import org.apache.http.util.EntityUtils;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.node.ArrayNode;
import org.codehaus.jackson.node.ObjectNode;

/** @author Aaron */
public abstract class AbstractItemApiTest extends AbstractRestApiTest {
Expand Down Expand Up @@ -194,9 +195,9 @@ protected ObjectNode putItemError(

protected void assertNameVersionStatus(
JsonNode itemNode, String name, int version, String status) {
assertEquals(itemNode.get("name").getTextValue(), name);
assertEquals(itemNode.get("version").getIntValue(), version);
assertEquals(itemNode.get("status").getTextValue(), status);
assertEquals(itemNode.get("name").asText(), name);
assertEquals(itemNode.get("version").asInt(), version);
assertEquals(itemNode.get("status").asText(), status);
}

protected void assertNulls(JsonNode tree, String... nodes) {
Expand All @@ -206,7 +207,7 @@ protected void assertNulls(JsonNode tree, String... nodes) {
}

protected void assertMetadata(JsonNode tree, String... pathsAndValues) {
PropBagEx metaXml = new PropBagEx(tree.get("metadata").getTextValue());
PropBagEx metaXml = new PropBagEx(tree.get("metadata").asText());
for (int i = 0; i < pathsAndValues.length; i += 2) {
String path = pathsAndValues[i];
String value = pathsAndValues[i + 1];
Expand All @@ -230,8 +231,8 @@ protected void assertUrlAttachment(
JsonNode urlAttachment, ItemId itemId, String title, String url) {
asserter.assertAttachmentBasics(
urlAttachment, itemId, "url", "32a79ea6-8b67-4b38-af85-341b2d512f09", title);
assertEquals(urlAttachment.get("url").getTextValue(), url);
assertEquals(urlAttachment.get("disabled").getBooleanValue(), false);
assertEquals(urlAttachment.get("url").asText(), url);
assertFalse(urlAttachment.get("disabled").asBoolean());
}

protected ItemId addDeletable(ObjectNode item) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.tle.webtests.test.webservices.rest;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.Lists;
import com.google.common.io.ByteStreams;
import com.google.common.io.CharStreams;
Expand Down Expand Up @@ -59,10 +63,6 @@
import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.node.ArrayNode;
import org.codehaus.jackson.node.ObjectNode;
import org.testng.Assert;
import org.testng.AssertJUnit;
import org.testng.annotations.BeforeClass;
Expand Down Expand Up @@ -179,7 +179,7 @@ protected String requestToken(OAuthClient client, PageContext contextToUse) thro
+ client.getSecret();
final HttpResponse response = execute(new HttpGet(tokenGetUrl), false);
final JsonNode tokenNode = readJson(mapper, response);
return tokenNode.get("access_token").getTextValue();
return tokenNode.get("access_token").asText();
}

protected String requestToken(String id) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.tle.common.Pair;
import java.net.URI;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.TimeZone;
import org.apache.http.HttpResponse;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.node.ObjectNode;
import org.testng.annotations.Test;

/** @author larry */
Expand Down
Loading

0 comments on commit 22a891f

Please sign in to comment.