From e0533da0f25b54e6ab5371a1a4510594a00f5c29 Mon Sep 17 00:00:00 2001 From: Frank Gasdorf Date: Fri, 5 Nov 2021 23:52:04 +0100 Subject: [PATCH] [CQ-2136] using org.apache.xml.resolver from Orbit (#574) * [CQ-18796] using Orbit org.apache.commons.io and exclude unused commons-math from libs-bundle Change-Id: Ic39792cd55b6e1cd734a4efba21fa579df4a3e12 Signed-off-by: Frank Gasdorf * [CQ-2136] using org.apache.xml.resolver from Orbit Change-Id: Ia8b98b4ee6ee5ca5c48bd72a31bccd1a2e827bee Signed-off-by: Frank Gasdorf --- .../org.locationtech.udig.target.target | 1 + .../org.locationtech.udig.libs.tests.launch | 206 ++++++++++++++---- .../udig/libs/tests/GeoToolsTest.java | 14 +- plugins/org.locationtech.udig.libs/.classpath | 1 - .../META-INF/MANIFEST.MF | 11 +- .../build.properties | 1 - .../org.locationtech.udig.libs/pom-libs.xml | 7 + 7 files changed, 187 insertions(+), 54 deletions(-) diff --git a/extras/org.locationtech.udig.target/org.locationtech.udig.target.target b/extras/org.locationtech.udig.target/org.locationtech.udig.target.target index bf958aa708..43b78dda04 100644 --- a/extras/org.locationtech.udig.target/org.locationtech.udig.target.target +++ b/extras/org.locationtech.udig.target/org.locationtech.udig.target.target @@ -131,6 +131,7 @@ + diff --git a/plugins/org.locationtech.udig.libs.tests/org.locationtech.udig.libs.tests.launch b/plugins/org.locationtech.udig.libs.tests/org.locationtech.udig.libs.tests.launch index f895d6a496..b7f4c71213 100644 --- a/plugins/org.locationtech.udig.libs.tests/org.locationtech.udig.libs.tests.launch +++ b/plugins/org.locationtech.udig.libs.tests/org.locationtech.udig.libs.tests.launch @@ -1,45 +1,167 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/org.locationtech.udig.libs.tests/src/org/locationtech/udig/libs/tests/GeoToolsTest.java b/plugins/org.locationtech.udig.libs.tests/src/org/locationtech/udig/libs/tests/GeoToolsTest.java index 3a0ab8f521..96057270ad 100644 --- a/plugins/org.locationtech.udig.libs.tests/src/org/locationtech/udig/libs/tests/GeoToolsTest.java +++ b/plugins/org.locationtech.udig.libs.tests/src/org/locationtech/udig/libs/tests/GeoToolsTest.java @@ -23,6 +23,7 @@ import org.geotools.renderer.style.svg.SVGGraphicFactory; import org.geotools.util.Version; import org.geotools.util.factory.GeoTools; +import org.geotools.xml.resolver.SchemaCatalog; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; @@ -39,7 +40,7 @@ * @since 1.2.0 */ public class GeoToolsTest { - + /** * @throws java.lang.Exception */ @@ -62,14 +63,14 @@ public void testGeoTools(){ @Test public void testSVGGraphicsFactory() throws Exception { URL url = GeoToolsTest.class.getResource("example.svg"); - + SVGGraphicFactory svgFactory = new SVGGraphicFactory(); FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); Literal expr = ff.literal( url.toExternalForm() ); - + Icon icon = svgFactory.getIcon(null, expr, "image/svg",16 ); assertNotNull( icon ); - + } // @Ignore("FIXME: due to migration to batik bundle from Orbit") @@ -81,4 +82,9 @@ public void testSVGGraphicsFactory() throws Exception { // SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); // f.createDocument(url.toString()); // } + + @Test + public void testLoadClassSchemaCatalogWithResolverDependencies() throws Exception { + assertNotNull("class need org.apache.xml.resolver dependency to load", SchemaCatalog.build(new URL("http://maven.apache.org/xsd/maven-4.0.0.xsd"))); + } } diff --git a/plugins/org.locationtech.udig.libs/.classpath b/plugins/org.locationtech.udig.libs/.classpath index 2c55a6c8f0..a83643b32a 100644 --- a/plugins/org.locationtech.udig.libs/.classpath +++ b/plugins/org.locationtech.udig.libs/.classpath @@ -194,7 +194,6 @@ - diff --git a/plugins/org.locationtech.udig.libs/META-INF/MANIFEST.MF b/plugins/org.locationtech.udig.libs/META-INF/MANIFEST.MF index ff1b495934..3ea4ad2b70 100644 --- a/plugins/org.locationtech.udig.libs/META-INF/MANIFEST.MF +++ b/plugins/org.locationtech.udig.libs/META-INF/MANIFEST.MF @@ -182,6 +182,11 @@ Import-Package: com.google.common.annotations;version="27.0.0", org.apache.commons.io.output;version="2.4.0", org.apache.ws.commons.serialize;version="1.0.2", org.apache.ws.commons.util;version="1.0.2", + org.apache.xml.resolver;version="1.2.0", + org.apache.xml.resolver.apps;version="1.2.0", + org.apache.xml.resolver.helpers;version="1.2.0", + org.apache.xml.resolver.readers;version="1.2.0", + org.apache.xml.resolver.tools;version="1.2.0", org.jfree;version="1.0.13", org.jfree.base;version="1.0.13", org.jfree.base.config;version="1.0.13", @@ -433,7 +438,6 @@ Bundle-ClassPath: ., lib/uom-lib-common-1.0.2.jar, lib/uom-se-1.0.8.jar, lib/wkb4j-1.0-RC1.jar, - lib/xml-commons-resolver-1.2.jar, lib/xpp3_min-1.1.4c.jar Export-Package: ., au.com.objectix.jgridshift, @@ -651,11 +655,6 @@ Export-Package: ., org.apache.commons.lang3.math;version="3.8.1", org.apache.commons.pool;version="1.5.4", org.apache.commons.pool.impl;version="1.5.4", - org.apache.xml.resolver;version="1.2.0", - org.apache.xml.resolver.apps;version="1.2.0", - org.apache.xml.resolver.helpers;version="1.2.0", - org.apache.xml.resolver.readers;version="1.2.0", - org.apache.xml.resolver.tools;version="1.2.0", org.codehaus.janino, org.codehaus.janino.samples, org.codehaus.janino.tools, diff --git a/plugins/org.locationtech.udig.libs/build.properties b/plugins/org.locationtech.udig.libs/build.properties index b82692ffcd..2908ad4667 100644 --- a/plugins/org.locationtech.udig.libs/build.properties +++ b/plugins/org.locationtech.udig.libs/build.properties @@ -205,7 +205,6 @@ bin.includes = .,\ lib/uom-lib-common-1.0.2.jar,\ lib/uom-se-1.0.8.jar,\ lib/wkb4j-1.0-RC1.jar,\ - lib/xml-commons-resolver-1.2.jar,\ log4j.xml,\ lib/xpp3_min-1.1.4c.jar src.includes = pom-libs.xml,\ diff --git a/plugins/org.locationtech.udig.libs/pom-libs.xml b/plugins/org.locationtech.udig.libs/pom-libs.xml index 5aea905065..f37bf74690 100644 --- a/plugins/org.locationtech.udig.libs/pom-libs.xml +++ b/plugins/org.locationtech.udig.libs/pom-libs.xml @@ -483,6 +483,13 @@ 3.1 provided + + org.apache.xml + xml-commons-resolver + 1.2 + provided + +