Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
essiembre committed Apr 25, 2017
2 parents d0af0e5 + 5e20001 commit 96c7953
Show file tree
Hide file tree
Showing 12 changed files with 216 additions and 74 deletions.
70 changes: 59 additions & 11 deletions norconex-committer-solr/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright 2010-2016 Norconex Inc.
Copyright 2010-2017 Norconex Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -19,15 +19,16 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.norconex.collectors</groupId>
<artifactId>norconex-committer-solr</artifactId>
<version>2.2.0</version>
<version>2.3.0</version>
<name>Norconex Committer Solr</name>


<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<site.baseurl/>
<solr.version>6.1.0</solr.version>
<solr.version>6.5.0</solr.version>
<norconex-commons-lang.version>1.13.0</norconex-commons-lang.version>
</properties>
<inceptionYear>2009</inceptionYear>

Expand Down Expand Up @@ -61,7 +62,7 @@
<dependency>
<groupId>com.norconex.collectors</groupId>
<artifactId>norconex-committer-core</artifactId>
<version>2.0.5</version>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -85,10 +86,33 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.norconex.commons</groupId>
<artifactId>norconex-commons-lang</artifactId>
<version>${norconex-commons-lang.version}</version>
<classifier>resources</classifier>
<type>zip</type>
<scope>provided</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependencies>
<dependency>
<groupId>com.norconex.commons</groupId>
<artifactId>norconex-commons-lang</artifactId>
<version>${norconex-commons-lang.version}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
Expand Down Expand Up @@ -185,8 +209,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
Expand Down Expand Up @@ -236,7 +260,7 @@
<overview>${basedir}/src/main/javadoc/overview.html</overview>
<show>protected</show>
<nodeprecated>false</nodeprecated>
<source>1.7</source>
<source>1.8</source>
<detectLinks>false</detectLinks>
<links>
<link>https://www.norconex.com/product/commons-lang/apidocs/</link>
Expand Down Expand Up @@ -278,14 +302,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
<excludes>
<exclude>THIRD-PARTY.txt</exclude>
</excludes>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -342,7 +369,28 @@
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>unpack-shared-resources</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<classifier>resources</classifier>
<outputDirectory>${project.build.directory}/shared-resources</outputDirectory>
<includeArtifacIds>norconex-commons-lang</includeArtifacIds>
<includeGroupIds>com.norconex.commons</includeGroupIds>
<excludeTransitive>true</excludeTransitive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -410,7 +458,7 @@
</footer>
<show>protected</show>
<nodeprecated>false</nodeprecated>
<source>1.7</source>
<source>1.8</source>
<detectLinks>false</detectLinks>
<links>
<link>https://www.norconex.com/product/commons-lang/apidocs/</link>
Expand Down
21 changes: 21 additions & 0 deletions norconex-committer-solr/src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,27 @@
<author email="info@norconex.com">Norconex Inc.</author>
</properties>
<body>

<release version="2.3.0" date="2017-04-25" description="Feature release">
<action dev="essiembre" type="add">
Added schema-based XML configuration validation.
</action>
<action dev="essiembre" type="add">
Now distributed with utility scripts.
</action>
<action dev="essiembre" type="update">
Now requires Java 8+ to run (Solr 6.x requirement).
</action>
<action dev="essiembre" type="update">
XML configuration entries expecting millisecond durations
can now be provided in human-readable format
(e.g., "5 minutes and 30 seconds" or "5m30s").
</action>
<action dev="essiembre" type="update">
Maven dependency updates: Norconex Commons Lang 1.13.0,
Norconex Committer Core 2.1.0, Apache Solr 6.5.0.
</action>
</release>

<release version="2.2.0" date="2016-08-26" description="Feature release">
<action dev="essiembre" type="add">
Expand Down
16 changes: 9 additions & 7 deletions norconex-committer-solr/src/main/assembly/dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
<includeSiteDirectory>false</includeSiteDirectory>

<fileSets>
<fileSet>
<directory>${basedir}/src/main/scripts</directory>
<includes>
<include>**</include>
</includes>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>${basedir}/src/main/assembly/</directory>
<includes>
Expand All @@ -45,6 +38,14 @@
<directory>${project.build.directory}/generated-resources</directory>
<outputDirectory>third-party</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/shared-resources</directory>
<excludes>
<exclude>scripts/decrypt*</exclude>
<exclude>scripts/encrypt*</exclude>
</excludes>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/generated-sources/license</directory>
<includes>
Expand All @@ -61,6 +62,7 @@
<exclude>hamcrest-core*</exclude>
</excludes>
<outputDirectory>lib</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}</outputFileNameMapping>
</dependencySet>
</dependencySets>
</assembly>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2010-2016 Norconex Inc.
/* Copyright 2010-2017 Norconex Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,13 +42,20 @@
import com.norconex.committer.core.ICommitOperation;
import com.norconex.committer.core.IDeleteOperation;
import com.norconex.commons.lang.map.Properties;
import com.norconex.commons.lang.time.DurationParser;

/**
* Commits documents to Apache Solr.
* <p>
* XML configuration usage:
* </p>
*
* <p>
* As of 2.2.1, XML configuration entries expecting millisecond durations
* can be provided in human-readable format (English only), as per
* {@link DurationParser} (e.g., "5 minutes and 30 seconds" or "5m30s").
* </p>
*
* <pre>
* &lt;committer class="com.norconex.committer.solr.SolrCommitter"&gt;
* &lt;solrURL&gt;(URL to Solr)&lt;/solrURL&gt;
Expand Down Expand Up @@ -87,7 +94,7 @@
* &lt;queueDir&gt;(optional path where to queue files)&lt;/queueDir&gt;
* &lt;queueSize&gt;(max queue size before sending to Solr)&lt;/queueSize&gt;
* &lt;maxRetries&gt;(max retries upon commit failures)&lt;/maxRetries&gt;
* &lt;maxRetryWait&gt;(max delay between retries)&lt;/maxRetryWait&gt;
* &lt;maxRetryWait&gt;(max delay in milliseconds between retries)&lt;/maxRetryWait&gt;
* &lt;/committer&gt;
* </pre>
*
Expand All @@ -105,8 +112,7 @@ public class SolrCommitter extends AbstractMappedCommitter {
private String solrURL;
private boolean solrCommitDisabled;

private final Map<String, String> updateUrlParams =
new HashMap<String, String>();
private final Map<String, String> updateUrlParams = new HashMap<>();

private final ISolrServerFactory solrServerFactory;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2017 Norconex Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:include schemaLocation="/com/norconex/committer/core/AbstractMappedCommitter.xsd"></xs:include>

<xs:element name="committer">
<xs:complexType>
<xs:complexContent>
<xs:extension base="AbstractMappedCommitter">
<xs:all>
<xs:element name="solrURL" type="nonEmptyString" minOccurs="1" maxOccurs="1" />
<xs:element name="solrCommitDisabled" type="xs:boolean" minOccurs="0" maxOccurs="1" />
<xs:element name="solrUpdateURLParams" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:all>
<xs:element name="param" type="paramType" minOccurs="1" maxOccurs="unbounded"/>
</xs:all>
</xs:complexType>
</xs:element>
</xs:all>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>

<xs:complexType name="paramType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="nonEmptyString"></xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<xs:simpleType name="nonEmptyString">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>

</xs:schema>
24 changes: 0 additions & 24 deletions norconex-committer-solr/src/main/scripts/install.bat

This file was deleted.

22 changes: 0 additions & 22 deletions norconex-committer-solr/src/main/scripts/install.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2010-2016 Norconex Inc.
/* Copyright 2010-2017 Norconex Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,7 +37,7 @@
import org.junit.rules.TemporaryFolder;

import com.norconex.committer.solr.SolrCommitter.ISolrServerFactory;
import com.norconex.commons.lang.config.ConfigurationUtil;
import com.norconex.commons.lang.config.XMLConfigurationUtil;
import com.norconex.commons.lang.map.Properties;

/**
Expand Down Expand Up @@ -330,7 +330,7 @@ public void testWriteRead() throws IOException {
// outCommitter.setDeleteUrlParam("dparam1", "dvalue1");
// outCommitter.setDeleteUrlParam("dparam2", "dvalue2");
System.out.println("Writing/Reading this: " + outCommitter);
ConfigurationUtil.assertWriteRead(outCommitter);
XMLConfigurationUtil.assertWriteRead(outCommitter);
}

}
Loading

0 comments on commit 96c7953

Please sign in to comment.