Skip to content

Commit

Permalink
Update Apache commons-compress dependency & bump version (#5)
Browse files Browse the repository at this point in the history
* Update Apache commons-compress dependency & bump version

When I built the POM in 2020, I missed that there was a later
version available with a different group ID, so we're using
an 18 year old version.

Also minor updates to the Maven version dependencies.

No functional changes, so just bump patch level.

* Update build

- remove Ant build file
- add Maven compiler plugin and set to Java 8
  (previously used Maven default Java 1.6)
- update Github actions to get rid of build warnings
- Java distribution remains 'azul' which
  was default before (no default now)
  • Loading branch information
tfmorris authored Mar 4, 2024
1 parent 018e6af commit 0fdbf52
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 50 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up Java 8 JDK
uses: actions/setup-java@v4
with:
java-version: 1.8
distribution: 'zulu'
java-version: 8
- name: Build with Maven
run: mvn -B package --file pom.xml
34 changes: 0 additions & 34 deletions build.xml

This file was deleted.

21 changes: 15 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.openrefine.dependencies</groupId>
<artifactId>vicino</artifactId>
<version>1.2</version>
<version>1.2.1</version>
<name>SIMILE Vicino</name>
<url>https://github.com/OpenRefine/simile-vicino</url>
<description>Vicino is near-neightbor search tool. The idea is be able to query data by distance search, with pluggable distance functions.</description>
<description>Vicino is near-neighbor search tool. The idea is be able to query data by distance search, with pluggable distance functions.</description>
<licenses>
<license>
<name>3-Clause BSD License</name>
Expand Down Expand Up @@ -49,17 +49,26 @@
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-compress</groupId>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>20050911</version>
<version>1.26.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -72,7 +81,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.6.3</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
10 changes: 4 additions & 6 deletions src/edu/mit/simile/vicino/distances/BZip2Distance.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;

import org.apache.commons.compress.bzip2.CBZip2OutputStream;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;

public class BZip2Distance extends PseudoMetricDistance {

public double d2(String x, String y) {
String str = x + y;
double result = 0.0f;
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream(str.length());
CBZip2OutputStream os = new CBZip2OutputStream(baos);

try (ByteArrayOutputStream baos = new ByteArrayOutputStream(str.length());
BZip2CompressorOutputStream os = new BZip2CompressorOutputStream(baos)) {
os.write(str.getBytes());
os.close();
baos.close();
result = baos.toByteArray().length;
} catch (IOException e) {
e.printStackTrace();
Expand Down

0 comments on commit 0fdbf52

Please sign in to comment.