prepare for Java 9, bump dependency versions

This commit is contained in:
Jörg Prante 2018-02-07 11:12:36 +01:00
parent d6591cd68e
commit 9aeb4e17e5
11 changed files with 43 additions and 30 deletions

View file

@ -1,14 +1,14 @@
group = org.xbib
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-marc.version = 1.0.17
helianthus.version = 1.0.10
tcnative.version = 2.0.1.Final
alpnagent.version = 2.0.6
helianthus.version = 1.0.13
tcnative.version = 2.0.7.Final
alpnagent.version = 2.0.7
junit.version 4.12
log4j.version = 2.8.2
wagon.version = 2.12
log4j.version = 2.10.0
wagon.version = 3.0.0
asciidoclet.version = 1.5.4

View file

@ -1,12 +1,13 @@
task xbibUpload(type: Upload, dependsOn: build) {
group = 'publish'
configuration = configurations.archives
uploadDescriptor = true
repositories {
if (project.hasProperty('xbibUsername')) {
mavenDeployer {
configuration = configurations.wagon
repository(url: uri('scpexe://xbib.org/repository')) {
repository(url: uri(project.property('xbibUrl'))) {
authentication(userName: xbibUsername, privateKey: xbibPrivateKey)
}
}
@ -15,6 +16,7 @@ task xbibUpload(type: Upload, dependsOn: build) {
}
task sonatypeUpload(type: Upload, dependsOn: build) {
group = 'publish'
configuration = configurations.archives
uploadDescriptor = true
repositories {
@ -64,3 +66,7 @@ task sonatypeUpload(type: Upload, dependsOn: build) {
}
}
}
nexusStaging {
packageGroup = "org.xbib"
}

View file

@ -1,8 +1,8 @@
tasks.withType(FindBugs) {
ignoreFailures = true
reports {
xml.enabled = true
html.enabled = false
xml.enabled = false
html.enabled = true
}
}
tasks.withType(Pmd) {

Binary file not shown.

View file

@ -1,6 +1,6 @@
#Wed Dec 06 21:25:32 CET 2017
#Wed Feb 07 09:29:06 CET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
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

View file

@ -2,6 +2,7 @@ package org.xbib.oai.client;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Ignore;
import org.junit.Test;
import org.xbib.helianthus.client.Clients;
import org.xbib.helianthus.client.http.HttpClient;
@ -37,6 +38,7 @@ public class BundeskunsthalleTest {
private static final Logger logger = LogManager.getLogger(BundeskunsthalleTest.class.getName());
@Test
@Ignore // takes too long time and creates files
public void testListRecords() throws Exception {
String spec = "http://www.bundeskunsthalle.de/cgi-bin/bib/oai-pmh";
try (OAIClient oaiClient = new OAIClient().setURL(new URL(spec), true)) {

View file

@ -38,6 +38,7 @@ public class DOAJClientTest {
private static final Logger logger = LogManager.getLogger(DOAJClientTest.class.getName());
@Test
@Ignore // takes too long time
public void testListRecordsDOAJ() throws Exception {
// will redirect to https://doaj.org/oai
try (OAIClient oaiClient = new OAIClient().setURL(new URL("http://doaj.org/oai"), true)) {

View file

@ -9,7 +9,6 @@ import java.io.Writer;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Deque;
import java.util.HashMap;
import java.util.Iterator;
@ -38,7 +37,7 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
private List<String> namespaces = new ArrayList<>();
private Deque<Collection<?>> nsStack = new ArrayDeque<>();
private Deque<Collection<Namespace>> nsStack = new ArrayDeque<>();
private Locator locator;
@ -92,7 +91,7 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
}
@Override
public void startDocument() throws SAXException {
public void startDocument() {
if (eventWriter == null) {
return;
}
@ -119,7 +118,7 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
}
@Override
public void startPrefixMapping(String prefix, String namespaceURI) throws SAXException {
public void startPrefixMapping(String prefix, String namespaceURI) {
if (eventWriter == null) {
return;
}
@ -138,7 +137,7 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
}
@Override
public void endPrefixMapping(String string) throws SAXException {
public void endPrefixMapping(String string) {
// not used
}
@ -155,15 +154,16 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
}
needToCallStartDocument = false;
}
Collection<?>[] events = {null, null};
createStartEvents(attributes, events);
nsStack.add(events[0]);
Collection<Attribute> attr = new ArrayList<>();
Collection<Namespace> ns = new ArrayList<>();
createStartEvents(attributes, attr, ns);
nsStack.add(ns);
try {
String[] q = {null, null};
parseQName(qname, q);
eventFactory.setLocation(getCurrentLocation());
eventWriter.add(eventFactory.createStartElement(q[0], uri,
q[1], events[1].iterator(), events[0].iterator()));
q[1], attr.iterator(), ns.iterator()));
} catch (XMLStreamException e) {
throw new SAXException(e);
}
@ -176,8 +176,7 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
}
String[] q = {null, null};
parseQName(qname, q);
Collection<?> nsList = nsStack.getLast();
Iterator<?> nsIter = nsList.iterator();
Iterator<Namespace> nsIter = nsStack.getLast().iterator();
try {
eventFactory.setLocation(getCurrentLocation());
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;
List<Attribute> attrs = null;
if (namespaces != null) {
@ -241,8 +240,12 @@ public class XmlSimpleMetadataHandler extends SimpleMetadataHandler implements O
attrs.add(attribute);
}
}
events[0] = nsMap == null ? Collections.emptyList() : nsMap.values();
events[1] = attrs == null ? Collections.emptyList() : attrs;
if (nsMap != null) {
nsList.addAll(nsMap.values());
}
if (attrs != null) {
attrList.addAll(attrs);
}
}
private void parseQName(String qName, String[] results) {

View file

@ -1,4 +1,4 @@
dependencies {
compile project(':oai-common')
compile "org.xbib.helianthus:helianthus-server:1.0.3"
compile "org.xbib.helianthus:helianthus-server:${project.property('helianthus.version')}"
}

View file

@ -2,15 +2,16 @@ package org.xbib.oai.server.verb;
import org.xbib.oai.OAIConstants;
import org.xbib.oai.exceptions.OAIException;
import org.xbib.oai.server.OAIServer;
import org.xbib.oai.server.AbstractOAIRequest;
import org.xbib.oai.server.AbstractOAIResponse;
import org.xbib.oai.server.OAIServer;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.TimeZone;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventFactory;
import javax.xml.stream.XMLStreamException;

View file

@ -1,9 +1,9 @@
package org.xbib.oai.server.verb;
import org.xbib.oai.exceptions.OAIException;
import org.xbib.oai.server.OAIServer;
import org.xbib.oai.server.AbstractOAIRequest;
import org.xbib.oai.server.AbstractOAIResponse;
import org.xbib.oai.server.OAIServer;
/**
*