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 cd614ca + 0d01ad3 commit 572c12e
Show file tree
Hide file tree
Showing 67 changed files with 4,473 additions and 1,136 deletions.
21 changes: 21 additions & 0 deletions norconex-commons-lang/TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
TODO:
==============

- Upgrade to Commons Configuration 2.x

- Upgrade to Apache Velocity 2.x when available in Maven.

- Modify Jar copier to handle cases where snapshot are timestamped instead and
not being considered the latest when they should. Like:
norconex-commons-lang-1.13.0-20170328.184247-17.jar vs
norconex-commons-lang-1.13.0-SNAPSHOT.jar
https://github.com/Norconex/collector-http/issues/331#issuecomment-290196986

- Consider splitting Properties by \u001e by default (record separator).

- Redo DurationUtil to be more flexible (using fluid builder approach.
or check Apache or Java 8 equivalent classes if they can be made as flexible.
Look at:
https://commons.apache.org/proper/commons-lang/javadocs/api-3.5/index.html?org/apache/commons/lang3/time/DurationFormatUtils.html
http://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatterBuilder.html
http://joda-time.sourceforge.net/apidocs/org/joda/time/format/PeriodFormatterBuilder.html
62 changes: 45 additions & 17 deletions norconex-commons-lang/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,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.norconex.commons</groupId>
<artifactId>norconex-commons-lang</artifactId>
<version>1.12.3</version>
<version>1.13.0</version>
<packaging>jar</packaging>
<name>Norconex Commons Lang</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<site.baseurl/>
<currentStableVersion>1.12.3</currentStableVersion>
<currentStableVersion>1.13.0</currentStableVersion>
</properties>
<inceptionYear>2008</inceptionYear>

Expand Down Expand Up @@ -72,7 +72,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
<version>3.5</version>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
Expand All @@ -94,6 +94,17 @@
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
</dependency>
<dependency>
<groupId>org.opengis.cite.xerces</groupId>
<artifactId>xercesImpl-xsd11</artifactId>
<version>2.12-beta-r1667115</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.10.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
Expand All @@ -103,6 +114,11 @@
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -218,19 +234,28 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/dist.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<id>make-dist-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<goals><goal>single</goal></goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/dist.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
<execution>
<id>make-resources-assembly</id>
<phase>package</phase>
<goals><goal>single</goal></goals>
<configuration>
<descriptors>
<descriptor>src/main/assembly/resources.xml</descriptor>
</descriptors>
<appendAssemblyId>true</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
Expand All @@ -246,7 +271,7 @@
<detectLinks>false</detectLinks>
<links>
<link>https://commons.apache.org/proper/commons-configuration/javadocs/v1.10/apidocs/</link>
<link>https://commons.apache.org/proper/commons-lang/javadocs/api-3.4/</link>
<link>https://commons.apache.org/proper/commons-lang/javadocs/api-3.5/</link>
</links>
</configuration>
<executions>
Expand Down Expand Up @@ -289,6 +314,9 @@
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
<excludes>
<exclude>THIRD-PARTY.txt</exclude>
</excludes>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -323,7 +351,7 @@
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -402,7 +430,7 @@
<detectLinks>false</detectLinks>
<links>
<link>https://commons.apache.org/proper/commons-configuration/javadocs/v1.10/apidocs/</link>
<link>https://commons.apache.org/proper/commons-lang/javadocs/api-3.4/</link>
<link>https://commons.apache.org/proper/commons-lang/javadocs/api-3.5/</link>
</links>
</configuration>
<reportSets>
Expand Down
76 changes: 76 additions & 0 deletions norconex-commons-lang/src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,82 @@
</properties>
<body>

<release version="1.13.0" date="2017-04-25" description="Feature release">
<action dev="essiembre" type="add">
New "exec" package containing classes moved from Norconex JEF API.
Those classes provide ways to easily execute external commands
as well as making code execution "retriable" in case of failure.
</action>
<action dev="essiembre" type="add">
IXMLConfigurable classes having XML schemas (XSD) are now validated
when loaded (using XML Schema 1.1).
</action>
<action dev="essiembre" type="add">
Now distributed with new command-line scripts for encryption,
safe copying of jars, finding jar duplicates, and automating
the installation of this library into other projects.
</action>
<action dev="essiembre" type="add">
New CountingConsoleAppender for tracking how many log events of each
type were logged (log4j).
</action>
<action dev="essiembre" type="add">
New ListErrorHandler which stores SAX Exceptions that can later
be retrieved as lists.
</action>
<action dev="essiembre" type="add">
New ClasspathResourceResolver and ClasspathInput to resolve XSD schema
includes/imports relative to each other in classpath.
</action>
<action dev="essiembre" type="add">
New XMLConfigurationUtil class replacing ConfigurationUtil, offering
new methods: #getCSVStringArray(...), #getCSVIntArray(...),
#validate(...), #loadFromXML(...), #newInstance(Reader),
#getDuration(...)
</action>
<action dev="essiembre" type="add">
New IInputStreamListener, InputStreamLineListener, and
InputStreamConsumer replacing now deprecated IStreamListener,
and StreamGobbler. These new classes allow streaming of binary content,
as well as text.
</action>
<action dev="essiembre" type="add">
New DurationParser class to parse plain-English durations into
milliseconds (e.g., "5 minutes and 30 seconds" or "5m30s").
</action>
<action dev="essiembre" type="add">
New URLNormalizer#removeTrailingHash() method.
</action>
<action dev="essiembre" type="add">
New JarFile#isSameVersion(...) and JarFile#isSameVersionAndTime(...)
methods.
</action>
<action dev="essiembre" type="add">
New constructor for EnhancedXMLStreamWriter enabling support for
indentation (pretty-print).
</action>
<action dev="essiembre" type="update">
ConfigurationLoadedUtil now deprecated in favor of XMLConfigurationUtil.
</action>
<action dev="essiembre" type="update">
JarDuplicateFinder now checks the last modified date when two versions
are the same.
</action>
<action dev="essiembre" type="update">
Now relies on Apache Xerces to parse XML Shema 1.1.
</action>
<action dev="essiembre" type="update">
Dependency updates: Apache Commons Lang 3.5, Apache Ant 1.10.1, Apache
Collections 3.2.2.
</action>
<action dev="essiembre" type="remove">
Removed all classes/methods deprecated since 1.5.0:
ConfigurationLoaded#loadXML(Reader in), .io.FileMonitor, .io.FileUtil,
.io.IFileChangeListener, .io.IFileVisitor,
.file.FileUtil#deleteFile(File), ClassFinder#findImplementors(...).
</action>
</release>

<release version="1.12.3" date="2016-11-15" description="Bugfix release">
<action dev="essiembre" type="update">
HttpURL no longer sets a null protocol when constructing non HTTP URLs.
Expand Down
3 changes: 3 additions & 0 deletions norconex-commons-lang/src/main/assembly/dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<directory>${basedir}/src/main/assembly/</directory>
<includes>
<include>*.txt</include>
<include>install.*</include>
<include>scripts/**</include>
</includes>
<outputDirectory>/</outputDirectory>
</fileSet>
Expand All @@ -53,6 +55,7 @@
<exclude>hamcrest-core*</exclude>
</excludes>
<outputDirectory>lib</outputDirectory>
<outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}</outputFileNameMapping>
</dependencySet>
</dependencySets>
</assembly>
37 changes: 37 additions & 0 deletions norconex-commons-lang/src/main/assembly/install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@echo off
REM Copyright 2017 Norconex Inc.
REM
REM Licensed under the Apache License, Version 2.0 (the "License");
REM you may not use this file except in compliance with the License.
REM You may obtain a copy of the License at
REM
REM http://www.apache.org/licenses/LICENSE-2.0
REM
REM Unless required by applicable law or agreed to in writing, software
REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
cd %~dp0

echo.
echo PLEASE READ CAREFULLY
echo.
echo To install this component and its dependencies into another product,
echo please specify the target product directory where libraries (.jar files)
echo can be found.
echo.
echo This is often a "lib" directory. For example, to install this component
echo into the Norconex HTTP Collector, specify the full path to the Collector
echo "lib" directory, which may look somewhat like this:
echo.
echo C:\MyProject\norconex-collector-http-x.x.x\lib
echo.
echo If .jar duplicates are found, you will be asked how you wish to deal with
echo them. It is recommended to try keep most recent versions upon encountering
echo version conflicts. When in doubt, simply choose the default option.
echo.

java -Dfile.encoding=UTF8 -cp "./lib/*;../lib/*" com.norconex.commons.lang.jar.JarCopier ./lib

pause
35 changes: 35 additions & 0 deletions norconex-commons-lang/src/main/assembly/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh
# 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.
cd $(dirname $0)

echo ""
echo "PLEASE READ CAREFULLY"
echo ""
echo "To install this component and its dependencies into another product,"
echo "please specify the target product directory where libraries (.jar files)"
echo "can be found."
echo ""
echo "This is often a \"lib\" directory. For example, to install this component"
echo "into the Norconex HTTP Collector, specify the full path to the Collector"
echo "\"lib\" directory, which may look somewhat like this:"
echo ""
echo " /myProject/norconex-collector-http-x.x.x/lib"
echo ""
echo "If .jar duplicates are found, you will be asked how you wish to deal with"
echo "them. It is recommended to try keep most recent versions upon encountering"
echo "version conflicts. When in doubt, simply choose the default option."
echo ""

java -Dfile.encoding=UTF8 -cp "./lib/*:../lib/*" com.norconex.commons.lang.jar.JarCopier "./lib"
34 changes: 34 additions & 0 deletions norconex-commons-lang/src/main/assembly/resources.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
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.
-->
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>resources</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${basedir}/src/main/assembly/</directory>
<includes>
<include>install.*</include>
<include>scripts/**</include>
</includes>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
</assembly>
Loading

0 comments on commit 572c12e

Please sign in to comment.