Skip to content

Commit

Permalink
Merge pull request #33 from AtlasOfLivingAustralia/issues/#32-shade-g…
Browse files Browse the repository at this point in the history
…uava

Fix #32 : Shade and upgrade Guava
  • Loading branch information
MattBlissett authored Mar 21, 2018
2 parents 055c5d0 + 86fbd74 commit 59c795b
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ target/
.classpath
.project
.settings/

dependency-reduced-pom.xml
39 changes: 30 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
<jdkLevel>1.8</jdkLevel>

<commons-io.version>2.5</commons-io.version>
<commons-lang.version>3.4</commons-lang.version>
<commons-lang.version>3.6</commons-lang.version>
<commons-digester.version>3.2</commons-digester.version>
<dwc-api.version>1.18-SNAPSHOT</dwc-api.version>
<freemarker.version>2.3.25-incubating</freemarker.version>
<gbif-common.version>0.38-SNAPSHOT</gbif-common.version>
<gbif-registry-metadata.version>2.59</gbif-registry-metadata.version>
<guava.version>18.0</guava.version>
<guava.version>23.0</guava.version>
<junit.version>4.12</junit.version>
<logback.version>1.1.7</logback.version>
<mockito.version>2.8.9</mockito.version>
<slf4j.version>1.7.21</slf4j.version>
<logback.version>1.2.3</logback.version>
<mockito.version>2.8.47</mockito.version>
<slf4j.version>1.7.25</slf4j.version>
</properties>

<repositories>
Expand All @@ -55,10 +55,31 @@
<build>
<defaultGoal>install</defaultGoal>
<plugins>
<!--
to build jar with all dependencies:
mvn assembly:single
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<artifactSet>
<includes>
<include>com.google.guava:guava</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.google.common</pattern>
<shadedPattern>org.gbif.dwcaio.shaded.com.google.common</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/gbif/dwca/record/RecordIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.gbif.utils.file.csv.CSVReader;

import java.io.IOException;
import java.util.Collections;
import java.util.Iterator;
import java.util.Map;

Expand Down Expand Up @@ -58,7 +59,7 @@ public RecordIterator(ClosableIterator<String[]> recordSource, ArchiveField id,
this.replaceEntities = replaceEntities;
closable = recordSource;
if (closable == null) {
Iterator<String[]> empty = Iterators.emptyIterator();
Iterator<String[]> empty = Collections.emptyIterator();
iter = Iterators.peekingIterator(empty);
} else {
iter = Iterators.peekingIterator(closable);
Expand Down

0 comments on commit 59c795b

Please sign in to comment.