Skip to content

Commit 75acda5

Browse files
committed
removed extra libraries for XML
1 parent 1f3d55e commit 75acda5

6 files changed

Lines changed: 7 additions & 71 deletions

File tree

jcp/pom.xml

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -155,27 +155,6 @@
155155
<artifactId>commons-codec</artifactId>
156156
<version>1.15</version>
157157
</dependency>
158-
<dependency>
159-
<groupId>xerces</groupId>
160-
<artifactId>xercesImpl</artifactId>
161-
<version>2.12.2</version>
162-
</dependency>
163-
<dependency>
164-
<groupId>xalan</groupId>
165-
<artifactId>xalan</artifactId>
166-
<version>2.7.2</version>
167-
<exclusions>
168-
<exclusion>
169-
<groupId>xml-apis</groupId>
170-
<artifactId>xml-apis</artifactId>
171-
</exclusion>
172-
</exclusions>
173-
</dependency>
174-
<dependency>
175-
<groupId>xml-apis</groupId>
176-
<artifactId>xml-apis</artifactId>
177-
<version>1.4.01</version>
178-
</dependency>
179158
<dependency>
180159
<groupId>org.projectlombok</groupId>
181160
<artifactId>lombok</artifactId>
@@ -375,10 +354,6 @@
375354
</goals>
376355
<configuration>
377356
<relocations>
378-
<relocation>
379-
<pattern>javax.xml</pattern>
380-
<shadedPattern>hidden.jcp.javax.xml</shadedPattern>
381-
</relocation>
382357
<relocation>
383358
<pattern>org.apache.commons</pattern>
384359
<shadedPattern>hidden.jcp.org.apache.commons</shadedPattern>
@@ -387,46 +362,10 @@
387362
<pattern>license</pattern>
388363
<shadedPattern>hidden.jcp.license</shadedPattern>
389364
</relocation>
390-
<relocation>
391-
<pattern>org.xml</pattern>
392-
<shadedPattern>hidden.jcp.org.xml</shadedPattern>
393-
</relocation>
394-
<relocation>
395-
<pattern>org.apache.xpath</pattern>
396-
<shadedPattern>hidden.jcp.org.apache.xpath</shadedPattern>
397-
</relocation>
398-
<relocation>
399-
<pattern>org.apache.xml</pattern>
400-
<shadedPattern>hidden.jcp.org.apache.xml</shadedPattern>
401-
</relocation>
402-
<relocation>
403-
<pattern>org.apache.wml</pattern>
404-
<shadedPattern>hidden.jcp.org.apache.wml</shadedPattern>
405-
</relocation>
406-
<relocation>
407-
<pattern>org.apache.regexp</pattern>
408-
<shadedPattern>hidden.jcp.org.apache.regexp</shadedPattern>
409-
</relocation>
410365
<relocation>
411366
<pattern>org.apache.html</pattern>
412367
<shadedPattern>hidden.jcp.org.apache.html</shadedPattern>
413368
</relocation>
414-
<relocation>
415-
<pattern>org.apache.bcel</pattern>
416-
<shadedPattern>hidden.jcp.org.apache.bcel</shadedPattern>
417-
</relocation>
418-
<relocation>
419-
<pattern>org.apache.xerces</pattern>
420-
<shadedPattern>hidden.jcp.org.apache.xerces</shadedPattern>
421-
</relocation>
422-
<relocation>
423-
<pattern>org.apache.xalan</pattern>
424-
<shadedPattern>hidden.jcp.org.apache.xalan</shadedPattern>
425-
</relocation>
426-
<relocation>
427-
<pattern>org.w3c</pattern>
428-
<shadedPattern>hidden.jcp.org.w3c</shadedPattern>
429-
</relocation>
430369
<relocation>
431370
<pattern>java_cup</pattern>
432371
<shadedPattern>hidden.jcp.java_cup</shadedPattern>
@@ -447,10 +386,7 @@
447386
<include>commons-codec:*</include>
448387
<include>commons-text:*</include>
449388
<include>org.apache.commons:*</include>
450-
<include>xerces:*</include>
451-
<include>xalan:*</include>
452389
<include>com.igormaznitsa:*</include>
453-
<include>xml-apis:*</include>
454390
</includes>
455391
</artifactSet>
456392
<filters>
@@ -460,10 +396,7 @@
460396
<exclude>META-INF/*.SF</exclude>
461397
<exclude>META-INF/*.DSA</exclude>
462398
<exclude>META-INF/*.RSA</exclude>
463-
<exclude>META-INF/services/javax.xml.*</exclude>
464399
<exclude>META-INF/services/org.apache.*</exclude>
465-
<exclude>META-INF/services/org.w3c.*</exclude>
466-
<exclude>META-INF/services/org.xml.*</exclude>
467400
</excludes>
468401
</filter>
469402
</filters>

jcp/src/main/java/com/igormaznitsa/jcp/expression/functions/xml/AbstractXMLFunction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import javax.xml.xpath.XPathExpression;
2828
import javax.xml.xpath.XPathExpressionException;
2929
import javax.xml.xpath.XPathFactory;
30-
import org.apache.xpath.jaxp.XPathFactoryImpl;
3130
import org.w3c.dom.Document;
3231
import org.w3c.dom.Element;
3332
import org.w3c.dom.Node;
@@ -102,7 +101,7 @@ public static String getFirstLevelTextContent(final Node node) {
102101

103102
protected static XPathExpression prepareXPathExpression(final String path)
104103
throws XPathExpressionException {
105-
final XPathFactory factory = new XPathFactoryImpl();
104+
final XPathFactory factory = XPathFactory.newInstance();
106105
final XPath xpath = factory.newXPath();
107106
return xpath.compile(path);
108107
}

jcp/src/main/java/com/igormaznitsa/jcp/expression/functions/xml/FunctionXML_OPEN.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
import com.igormaznitsa.jcp.expression.ValueType;
3030
import java.io.File;
3131
import java.io.IOException;
32+
import javax.xml.parsers.DocumentBuilderFactory;
3233
import javax.xml.parsers.ParserConfigurationException;
33-
import org.apache.xerces.jaxp.DocumentBuilderFactoryImpl;
3434
import org.w3c.dom.Document;
3535
import org.xml.sax.SAXException;
3636

@@ -85,7 +85,7 @@ public Value executeStr(final PreprocessorContext context, final Value filePath)
8585

8686

8787
private Document openFileAndParse(final PreprocessorContext context, final File file) {
88-
final DocumentBuilderFactoryImpl docBuilderFactory = new DocumentBuilderFactoryImpl();
88+
final DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
8989
docBuilderFactory.setIgnoringComments(true);
9090
docBuilderFactory.setCoalescing(true);
9191
docBuilderFactory.setValidating(false);

jcp/src/test/java/com/igormaznitsa/jcp/AbstractMockPreprocessorContextTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import com.igormaznitsa.jcp.exceptions.PreprocessorException;
2929
import com.igormaznitsa.jcp.utils.ResetablePrinter;
3030
import org.junit.runner.RunWith;
31+
import org.powermock.core.classloader.annotations.PowerMockIgnore;
3132
import org.powermock.core.classloader.annotations.PrepareForTest;
3233
import org.powermock.modules.junit4.PowerMockRunner;
3334

jcp/src/test/java/com/igormaznitsa/jcp/expression/functions/AbstractFunctionTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@
3232
import java.util.Arrays;
3333
import java.util.HashMap;
3434
import java.util.Map;
35+
import org.powermock.core.classloader.annotations.PowerMockIgnore;
3536

3637
import static java.util.Collections.singletonList;
3738
import static org.junit.Assert.*;
3839

40+
@PowerMockIgnore({"com.sun.*","com.oracle.*","javax.*","org.w3c.*", "org.xml.*", "java.*"})
3941
public abstract class AbstractFunctionTest extends AbstractSpyPreprocessorContextTest {
4042

4143
protected static Map<String, Value> var(final Map<String, Value> map, final String name, final Value val) {

jcp/src/test/java/com/igormaznitsa/jcp/expression/functions/xml/AbstractFunctionXMLTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.io.File;
3333
import org.junit.Before;
3434
import org.mockito.stubbing.Answer;
35+
import org.powermock.core.classloader.annotations.PowerMockIgnore;
3536

3637
public abstract class AbstractFunctionXMLTest extends AbstractFunctionTest {
3738

0 commit comments

Comments
 (0)