diff --git a/gradle.properties b/gradle.properties index c5ac801..c6863a3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 \ No newline at end of file diff --git a/gradle/publish.gradle b/gradle/publish.gradle index caf0531..7bf8ad6 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -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" +} diff --git a/gradle/sonarqube.gradle b/gradle/sonarqube.gradle index 0a37566..3985a4f 100644 --- a/gradle/sonarqube.gradle +++ b/gradle/sonarqube.gradle @@ -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) { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 6b6ea3a..c44b679 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bd637f3..cad203e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/oai-client/src/test/java/org/xbib/oai/client/BundeskunsthalleTest.java b/oai-client/src/test/java/org/xbib/oai/client/BundeskunsthalleTest.java index f127cc9..88f97b4 100644 --- a/oai-client/src/test/java/org/xbib/oai/client/BundeskunsthalleTest.java +++ b/oai-client/src/test/java/org/xbib/oai/client/BundeskunsthalleTest.java @@ -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)) { diff --git a/oai-client/src/test/java/org/xbib/oai/client/DOAJClientTest.java b/oai-client/src/test/java/org/xbib/oai/client/DOAJClientTest.java index 311b376..4d14a79 100644 --- a/oai-client/src/test/java/org/xbib/oai/client/DOAJClientTest.java +++ b/oai-client/src/test/java/org/xbib/oai/client/DOAJClientTest.java @@ -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)) { diff --git a/oai-common/src/main/java/org/xbib/oai/xml/XmlSimpleMetadataHandler.java b/oai-common/src/main/java/org/xbib/oai/xml/XmlSimpleMetadataHandler.java index dd21c58..9471135 100644 --- a/oai-common/src/main/java/org/xbib/oai/xml/XmlSimpleMetadataHandler.java +++ b/oai-common/src/main/java/org/xbib/oai/xml/XmlSimpleMetadataHandler.java @@ -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 namespaces = new ArrayList<>(); - private Deque> nsStack = new ArrayDeque<>(); + private Deque> 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 attr = new ArrayList<>(); + Collection 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 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 attrList, Collection nsList) { Map nsMap = null; List 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) { diff --git a/oai-server/build.gradle b/oai-server/build.gradle index 867ba01..48725cc 100644 --- a/oai-server/build.gradle +++ b/oai-server/build.gradle @@ -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')}" } \ No newline at end of file diff --git a/oai-server/src/main/java/org/xbib/oai/server/verb/AbstractVerb.java b/oai-server/src/main/java/org/xbib/oai/server/verb/AbstractVerb.java index bb27c90..320e743 100644 --- a/oai-server/src/main/java/org/xbib/oai/server/verb/AbstractVerb.java +++ b/oai-server/src/main/java/org/xbib/oai/server/verb/AbstractVerb.java @@ -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; diff --git a/oai-server/src/main/java/org/xbib/oai/server/verb/ListMetadataFormats.java b/oai-server/src/main/java/org/xbib/oai/server/verb/ListMetadataFormats.java index 72d3cad..20e03d7 100644 --- a/oai-server/src/main/java/org/xbib/oai/server/verb/ListMetadataFormats.java +++ b/oai-server/src/main/java/org/xbib/oai/server/verb/ListMetadataFormats.java @@ -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; /** *