Skip to content

Commit

Permalink
Configured Maven for Java 8
Browse files Browse the repository at this point in the history
  • Loading branch information
cavorite committed Feb 7, 2023
1 parent 503cdbd commit fce3b8b
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 138 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/maven-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Java CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
- name: Build with Maven
run: mvn --batch-mode --update-snapshots package
30 changes: 0 additions & 30 deletions .github/workflows/mavenpublish.yml

This file was deleted.

11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/target
my-idx
.settings/
.project
*.iml
*.swp
.DS_Store
.classpath
.idea/
*.iml
dependency-reduced-pom.xml
.project
.sdkmanrc
.settings
dependency-reduced-pom.xml
79 changes: 42 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
CLue - Command Line tool for Apache Lucene
CLue - Command Line Tool for Apache Lucene
==========================================

### Overview:
## Overview

When working with Lucene, it is often useful to inspect an index.

[Luke](http://www.getopt.org/luke/) is awesome, but often times it is not feasible to inspect an index on a remote machine using a GUI. That's where Clue comes in.
[Luke](http://www.getopt.org/luke/) is awesome, but often times it is not feasible to inspect an index on a remote
machine using a GUI. That's where Clue comes in.
You can ssh into your production box and inspect your index using your favorite shell.

Another important feature for Clue is the ability to interact with other Unix commands via piping, e.g. grep, more etc.

#### License:
## About this fork

Clue is under the [Apache Public License v2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
This is a fork from the upstream version: [javasoze/clue](https://github.com/javasoze/clue/). It's built for Lucene 8
and requires Java 8 (instead of Java 11, which is needed for newer versions of Lucene).

#### Bugs:
### License

Clue is under the [Apache Public License v2.0](http//www.apache.org/licenses/LICENSE-2.0.html).

### Bugs

Please file bugs and feature requests [here](https://github.com/javasoze/clue/issues).

### Downloads:
## Downloads

latest version: 8.5.0-1.0.0
latest version: java8-8.11.2-1.0.0

#### What's new in this release?
### What's new in this release?

See [Release Note](https://github.com/javasoze/clue/releases/tag/release-8.5.0-1.0.0)
See [Release Note](https://github.com/cavorite/clue/releases/tag/release-java8-8.11.2-1.0.0)

### Build:
## Build

mvn package

This will create the following artifact in the target directory:

```clue-${VERSION}.jar```

### Run:
## Run

Interactive Mode:

Expand Down Expand Up @@ -73,54 +79,53 @@ Command list:
terms - gets terms from the index, <field:term>, term can be a prefix
trim - trims the index, <TRIM PERCENTAGE> <OPTIONS>, options are: head, tail, random
tv - shows term vector of a field for a doc
### Build a sample index to play with:

## Build a sample index to play with

Clue bundles with some test data (15000 car data) for you to build a sample index to play with, do:

./bin/build_sample_index.sh my-idx


### Examples:
## Examples

1. Getting all the terms in the field 'color_indexed':

**./bin/clue.sh my-idx terms color_indexed**
``./bin/clue.sh my-idx terms color_indexed``

2. Getting all the terms in the field 'color_indexed' starting with the term staring with 'r':

**./bin/clue.sh my-idx terms color_indexed:r**
``./bin/clue.sh my-idx terms color_indexed:r``

``./bin/clue.sh my-idx terms color_indexed | grep r``

4. Do a search:

**./bin/clue.sh my-idx terms color_indexed | grep r**
``./bin/clue.sh my-idx search myquery``

3. Do a search:
5. Get the index info:

**./bin/clue.sh my-idx search myquery**
``./bin/clue.sh my-idx info``

4. Get the index info:
6. Iterate a posting for the term color_indexed:red

**./bin/clue.sh my-idx info**
``./bin/clue.sh my-idx postings color_indexed:red``

5. Iterate a posting for the term color_indexed:red
7. List docvalues for the column-stride-field color:

**./bin/clue.sh my-idx postings color_indexed:red**
``./bin/clue.sh my-idx docval color``

6. List docvalues for the column-stride-field color:
8. Get docvalue for the column-stride-field *category* for document 4:

**./bin/clue.sh my-idx docval color**
``./bin/clue.sh my-idx docval *category* 5``

7. Get docvalue for the column-stride-field *category* for document 4:
9. Get docvalue for the column-stride-field *year* of type numeric for document 3:

**./bin/clue.sh my-idx docval *category* 5**
``./bin/clue.sh my-idx docval year 3``

8. Get docvalue for the column-stride-field *year* of type numeric for document 3:
10. Get docvalue for the column-stride-field *json* of type binary for document 3:

**./bin/clue.sh my-idx docval year 3**

9. Get docvalue for the column-stride-field *json* of type binary for document 3:
``./bin/clue.sh my-idx docval json 3``

**./bin/clue.sh my-idx docval json 3**

9. Get docvalue for the column-stride-field *tags* of type sorted-set for document 3:
11. Get docvalue for the column-stride-field *tags* of type sorted-set for document 3:

**./bin/clue.sh my-idx docval tags 3**
``./bin/clue.sh my-idx docval tags 3``
98 changes: 33 additions & 65 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>clue</artifactId>
<packaging>jar</packaging>
<name>clue</name>
<version>8.5.0-1.0.0</version>
<version>java8-8.11.2-1.0.0</version>
<description>command line client for Apache Lucene</description>

<url>http://github.com/javasoze/clue</url>
Expand All @@ -20,9 +20,9 @@
</licenses>

<scm>
<connection>scm:git://github.com/javasoze/clue.git</connection>
<developerConnection>scm:git@github.com:javasoze/clue.git</developerConnection>
<url>http://github.com/javasoze/clue</url>
<connection>scm:git://github.com/cavorite/clue.git</connection>
<developerConnection>scm:git@github.com:cavorite/clue.git</developerConnection>
<url>http://github.com/cavorite/clue</url>
</scm>

<developers>
Expand All @@ -31,92 +31,60 @@
<name>John Wang</name>
<email>john.wang@gmail.com</email>
</developer>
<developer>
<id>cavorite</id>
<name>Juan Manuel Caicedo Carvajal</name>
<url>https://cavorite.com</url>
</developer>
</developers>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>io.dashbase.clue.ClueApplication</mainClass>
<lucene.version>8.5.0</lucene.version>
<lucene.version>8.11.2</lucene.version>
<dropwizard.version>1.3.5</dropwizard.version>
<retrofit2.version>2.5.0</retrofit2.version>
</properties>

<!-- Set the compiler to java6 -->
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<source>10</source>
<target>10</target>
<source>8</source>
<target>8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<!--
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${mainClass}</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/libs</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
-->
</plugins>
<extensions>
<!-- Enabling the use of FTP -->
<extension>
<groupId>org.kuali.maven.wagons</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>1.2.1</version>
</extension>
<!-- Enabling the use of FTP -->
<extension>
<groupId>org.kuali.maven.wagons</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>1.2.1</version>
</extension>
</extensions>
</build>

Expand Down Expand Up @@ -240,10 +208,10 @@

<distributionManagement>
<repository>
<id>github</id>
<name>clue</name>
<url>https://maven.pkg.github.com/javasoze/clue</url>
<id>github</id>
<name>clue</name>
<url>https://maven.pkg.github.com/javasoze/clue</url>
</repository>
</distributionManagement>
</distributionManagement>
</project>

4 changes: 2 additions & 2 deletions src/main/java/io/dashbase/clue/client/ClueCommandClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.io.ByteStreams;
import jline.console.ConsoleReader;
import jline.console.completer.ArgumentCompleter;
import jline.console.completer.Completer;
Expand Down Expand Up @@ -121,8 +122,7 @@ public void handleCommand(String cmdName, String[] args, PrintStream out) {

Response<ResponseBody> response = call.execute();
try (ResponseBody responseBody = response.body()) {
InputStream is = responseBody.byteStream();
is.transferTo(System.out);
ByteStreams.copy(responseBody.byteStream(), System.out);
}
} catch (Exception e) {
e.printStackTrace(out);
Expand Down

0 comments on commit fce3b8b

Please sign in to comment.