prepare for Java 9, bump dependency versions
This commit is contained in:
parent
d6591cd68e
commit
9aeb4e17e5
11 changed files with 43 additions and 30 deletions
|
@ -1,14 +1,14 @@
|
||||||
group = org.xbib
|
group = org.xbib
|
||||||
name = oai
|
name = oai
|
||||||
version = 1.1.0
|
version = 1.2.0
|
||||||
|
|
||||||
xbib-content.version = 1.1.0
|
xbib-content.version = 1.3.0
|
||||||
|
xbib-marc.version = 1.1.0
|
||||||
xbib-bibliographic-character-sets.version = 1.0.0
|
xbib-bibliographic-character-sets.version = 1.0.0
|
||||||
xbib-marc.version = 1.0.17
|
helianthus.version = 1.0.13
|
||||||
helianthus.version = 1.0.10
|
tcnative.version = 2.0.7.Final
|
||||||
tcnative.version = 2.0.1.Final
|
alpnagent.version = 2.0.7
|
||||||
alpnagent.version = 2.0.6
|
|
||||||
junit.version 4.12
|
junit.version 4.12
|
||||||
log4j.version = 2.8.2
|
log4j.version = 2.10.0
|
||||||
wagon.version = 2.12
|
wagon.version = 3.0.0
|
||||||
asciidoclet.version = 1.5.4
|
asciidoclet.version = 1.5.4
|
|
@ -1,12 +1,13 @@
|
||||||
|
|
||||||
task xbibUpload(type: Upload, dependsOn: build) {
|
task xbibUpload(type: Upload, dependsOn: build) {
|
||||||
|
group = 'publish'
|
||||||
configuration = configurations.archives
|
configuration = configurations.archives
|
||||||
uploadDescriptor = true
|
uploadDescriptor = true
|
||||||
repositories {
|
repositories {
|
||||||
if (project.hasProperty('xbibUsername')) {
|
if (project.hasProperty('xbibUsername')) {
|
||||||
mavenDeployer {
|
mavenDeployer {
|
||||||
configuration = configurations.wagon
|
configuration = configurations.wagon
|
||||||
repository(url: uri('scpexe://xbib.org/repository')) {
|
repository(url: uri(project.property('xbibUrl'))) {
|
||||||
authentication(userName: xbibUsername, privateKey: xbibPrivateKey)
|
authentication(userName: xbibUsername, privateKey: xbibPrivateKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +16,7 @@ task xbibUpload(type: Upload, dependsOn: build) {
|
||||||
}
|
}
|
||||||
|
|
||||||
task sonatypeUpload(type: Upload, dependsOn: build) {
|
task sonatypeUpload(type: Upload, dependsOn: build) {
|
||||||
|
group = 'publish'
|
||||||
configuration = configurations.archives
|
configuration = configurations.archives
|
||||||
uploadDescriptor = true
|
uploadDescriptor = true
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -64,3 +66,7 @@ task sonatypeUpload(type: Upload, dependsOn: build) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nexusStaging {
|
||||||
|
packageGroup = "org.xbib"
|
||||||
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
tasks.withType(FindBugs) {
|
tasks.withType(FindBugs) {
|
||||||
ignoreFailures = true
|
ignoreFailures = true
|
||||||
reports {
|
reports {
|
||||||
xml.enabled = true
|
xml.enabled = false
|
||||||
html.enabled = false
|
html.enabled = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tasks.withType(Pmd) {
|
tasks.withType(Pmd) {
|
||||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
#Wed Dec 06 21:25:32 CET 2017
|
#Wed Feb 07 09:29:06 CET 2018
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-all.zip
|
||||||
|
|
|
@ -2,6 +2,7 @@ package org.xbib.oai.client;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.xbib.helianthus.client.Clients;
|
import org.xbib.helianthus.client.Clients;
|
||||||
import org.xbib.helianthus.client.http.HttpClient;
|
import org.xbib.helianthus.client.http.HttpClient;
|
||||||
|
@ -37,6 +38,7 @@ public class BundeskunsthalleTest {
|
||||||
private static final Logger logger = LogManager.getLogger(BundeskunsthalleTest.class.getName());
|
private static final Logger logger = LogManager.getLogger(BundeskunsthalleTest.class.getName());
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore // takes too long time and creates files
|
||||||
public void testListRecords() throws Exception {
|
public void testListRecords() throws Exception {
|
||||||
String spec = "http://www.bundeskunsthalle.de/cgi-bin/bib/oai-pmh";
|
String spec = "http://www.bundeskunsthalle.de/cgi-bin/bib/oai-pmh";
|
||||||
try (OAIClient oaiClient = new OAIClient().setURL(new URL(spec), true)) {
|
try (OAIClient oaiClient = new OAIClient().setURL(new URL(spec), true)) {
|
||||||
|
|
|
@ -38,6 +38,7 @@ public class DOAJClientTest {
|
||||||
private static final Logger logger = LogManager.getLogger(DOAJClientTest.class.getName());
|
private static final Logger logger = LogManager.getLogger(DOAJClientTest.class.getName());
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@Ignore // takes too long time
|
||||||
public void testListRecordsDOAJ() throws Exception {
|
public void testListRecordsDOAJ() throws Exception {
|
||||||
// will redirect to https://doaj.org/oai
|
// will redirect to https://doaj.org/oai
|
||||||
try (OAIClient oaiClient = new OAIClient().setURL(new URL("http://doaj.org/oai"), true)) {
|
try (OAIClient oaiClient = new OAIClient().setURL(new URL("http://doaj.org/oai"), true)) {
|
||||||
|
|
|
@ -9,7 +9,6 @@ import java.io.Writer;
|
||||||
import java.util.ArrayDeque;
|
import java.util.ArrayDeque;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Deque;
|
import java.util.Deque;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -38,7 +37,7 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
|
||||||
|
|
||||||
private List<String> namespaces = new ArrayList<>();
|
private List<String> namespaces = new ArrayList<>();
|
||||||
|
|
||||||
private Deque<Collection<?>> nsStack = new ArrayDeque<>();
|
private Deque<Collection<Namespace>> nsStack = new ArrayDeque<>();
|
||||||
|
|
||||||
private Locator locator;
|
private Locator locator;
|
||||||
|
|
||||||
|
@ -92,7 +91,7 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startDocument() throws SAXException {
|
public void startDocument() {
|
||||||
if (eventWriter == null) {
|
if (eventWriter == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +118,7 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startPrefixMapping(String prefix, String namespaceURI) throws SAXException {
|
public void startPrefixMapping(String prefix, String namespaceURI) {
|
||||||
if (eventWriter == null) {
|
if (eventWriter == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +137,7 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void endPrefixMapping(String string) throws SAXException {
|
public void endPrefixMapping(String string) {
|
||||||
// not used
|
// not used
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,15 +154,16 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
|
||||||
}
|
}
|
||||||
needToCallStartDocument = false;
|
needToCallStartDocument = false;
|
||||||
}
|
}
|
||||||
Collection<?>[] events = {null, null};
|
Collection<Attribute> attr = new ArrayList<>();
|
||||||
createStartEvents(attributes, events);
|
Collection<Namespace> ns = new ArrayList<>();
|
||||||
nsStack.add(events[0]);
|
createStartEvents(attributes, attr, ns);
|
||||||
|
nsStack.add(ns);
|
||||||
try {
|
try {
|
||||||
String[] q = {null, null};
|
String[] q = {null, null};
|
||||||
parseQName(qname, q);
|
parseQName(qname, q);
|
||||||
eventFactory.setLocation(getCurrentLocation());
|
eventFactory.setLocation(getCurrentLocation());
|
||||||
eventWriter.add(eventFactory.createStartElement(q[0], uri,
|
eventWriter.add(eventFactory.createStartElement(q[0], uri,
|
||||||
q[1], events[1].iterator(), events[0].iterator()));
|
q[1], attr.iterator(), ns.iterator()));
|
||||||
} catch (XMLStreamException e) {
|
} catch (XMLStreamException e) {
|
||||||
throw new SAXException(e);
|
throw new SAXException(e);
|
||||||
}
|
}
|
||||||
|
@ -176,8 +176,7 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
|
||||||
}
|
}
|
||||||
String[] q = {null, null};
|
String[] q = {null, null};
|
||||||
parseQName(qname, q);
|
parseQName(qname, q);
|
||||||
Collection<?> nsList = nsStack.getLast();
|
Iterator<Namespace> nsIter = nsStack.getLast().iterator();
|
||||||
Iterator<?> nsIter = nsList.iterator();
|
|
||||||
try {
|
try {
|
||||||
eventFactory.setLocation(getCurrentLocation());
|
eventFactory.setLocation(getCurrentLocation());
|
||||||
eventWriter.add(eventFactory.createEndElement(q[0], uri, q[1], nsIter));
|
eventWriter.add(eventFactory.createEndElement(q[0], uri, q[1], nsIter));
|
||||||
|
@ -199,7 +198,7 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createStartEvents(Attributes attributes, Collection<?>[] events) {
|
private void createStartEvents(Attributes attributes, Collection<Attribute> attrList, Collection<Namespace> nsList) {
|
||||||
Map<String, Namespace> nsMap = null;
|
Map<String, Namespace> nsMap = null;
|
||||||
List<Attribute> attrs = null;
|
List<Attribute> attrs = null;
|
||||||
if (namespaces != null) {
|
if (namespaces != null) {
|
||||||
|
@ -241,8 +240,12 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
|
||||||
attrs.add(attribute);
|
attrs.add(attribute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
events[0] = nsMap == null ? Collections.emptyList() : nsMap.values();
|
if (nsMap != null) {
|
||||||
events[1] = attrs == null ? Collections.emptyList() : attrs;
|
nsList.addAll(nsMap.values());
|
||||||
|
}
|
||||||
|
if (attrs != null) {
|
||||||
|
attrList.addAll(attrs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseQName(String qName, String[] results) {
|
private void parseQName(String qName, String[] results) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':oai-common')
|
compile project(':oai-common')
|
||||||
compile "org.xbib.helianthus:helianthus-server:1.0.3"
|
compile "org.xbib.helianthus:helianthus-server:${project.property('helianthus.version')}"
|
||||||
}
|
}
|
|
@ -2,15 +2,16 @@ package org.xbib.oai.server.verb;
|
||||||
|
|
||||||
import org.xbib.oai.OAIConstants;
|
import org.xbib.oai.OAIConstants;
|
||||||
import org.xbib.oai.exceptions.OAIException;
|
import org.xbib.oai.exceptions.OAIException;
|
||||||
import org.xbib.oai.server.OAIServer;
|
|
||||||
import org.xbib.oai.server.AbstractOAIRequest;
|
import org.xbib.oai.server.AbstractOAIRequest;
|
||||||
import org.xbib.oai.server.AbstractOAIResponse;
|
import org.xbib.oai.server.AbstractOAIResponse;
|
||||||
|
import org.xbib.oai.server.OAIServer;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import javax.xml.namespace.QName;
|
import javax.xml.namespace.QName;
|
||||||
import javax.xml.stream.XMLEventFactory;
|
import javax.xml.stream.XMLEventFactory;
|
||||||
import javax.xml.stream.XMLStreamException;
|
import javax.xml.stream.XMLStreamException;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package org.xbib.oai.server.verb;
|
package org.xbib.oai.server.verb;
|
||||||
|
|
||||||
import org.xbib.oai.exceptions.OAIException;
|
import org.xbib.oai.exceptions.OAIException;
|
||||||
import org.xbib.oai.server.OAIServer;
|
|
||||||
import org.xbib.oai.server.AbstractOAIRequest;
|
import org.xbib.oai.server.AbstractOAIRequest;
|
||||||
import org.xbib.oai.server.AbstractOAIResponse;
|
import org.xbib.oai.server.AbstractOAIResponse;
|
||||||
|
import org.xbib.oai.server.OAIServer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue