Remove parboiled-java and minor cleanup of unused OAI dependencies

This commit is contained in:
Tim Donohue
2024-11-15 11:30:14 -06:00
parent 06e501c5f6
commit 6183997add
4 changed files with 8 additions and 28 deletions

View File

@@ -99,22 +99,9 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
<!-- More recent version is pulled in via below dependencies -->
<exclusion>
<groupId>org.parboiled</groupId>
<artifactId>parboiled-java</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Newer version, necessary to align with newer version of ASM in parent POM
This is needed by both jtwig-spring-boot-starter and our tests. -->
<dependency>
<groupId>org.parboiled</groupId>
<artifactId>parboiled-java</artifactId>
<version>1.3.1</version>
</dependency>
<!-- Internal -->
<dependency>
<groupId>org.dspace</groupId>
@@ -137,15 +124,7 @@
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>runtime</scope>
</dependency>
<!-- TODO: This "bridge" should be removed as we should not support Log4j v1 syntax anymore -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>

View File

@@ -11,7 +11,7 @@ import java.util.List;
import com.lyncode.xoai.dataprovider.xml.xoai.Element;
import com.lyncode.xoai.dataprovider.xml.xoai.Metadata;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.dspace.content.Item;
import org.dspace.core.Context;
import org.dspace.license.factory.LicenseServiceFactory;

View File

@@ -9,7 +9,7 @@ package org.dspace.xoai.app;
import static com.lyncode.xoai.dataprovider.core.Granularity.Second;
import static java.util.Objects.nonNull;
import static org.apache.commons.lang.StringUtils.EMPTY;
import static org.apache.commons.lang3.StringUtils.EMPTY;
import static org.apache.solr.common.params.CursorMarkParams.CURSOR_MARK_PARAM;
import static org.apache.solr.common.params.CursorMarkParams.CURSOR_MARK_START;
import static org.dspace.xoai.util.ItemUtils.retrieveMetadata;

View File

@@ -13,13 +13,14 @@ import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import java.io.InputStream;
import java.nio.charset.Charset;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamSource;
import com.lyncode.xoai.util.XSLPipeline;
import org.apache.commons.io.IOUtils;
import org.dspace.xoai.tests.support.XmlMatcherBuilder;
import org.junit.Test;
import org.parboiled.common.FileUtils;
public class PipelineTest {
private static TransformerFactory factory = TransformerFactory.newInstance();
@@ -28,9 +29,9 @@ public class PipelineTest {
public void pipelineTest() throws Exception {
InputStream input = PipelineTest.class.getClassLoader().getResourceAsStream("item.xml");
InputStream xslt = PipelineTest.class.getClassLoader().getResourceAsStream("oai_dc.xsl");
String output = FileUtils.readAllText(new XSLPipeline(input, true)
String output = IOUtils.toString(new XSLPipeline(input, true)
.apply(factory.newTemplates(new StreamSource(xslt)))
.getTransformed());
.getTransformed(), Charset.defaultCharset());
assertThat(output, oai_dc().withXPath("/oai_dc:dc/dc:title", equalTo("Teste")));