Skip to content

Commit

Permalink
clean up (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
javasoze authored Jan 8, 2018
1 parent 10892e0 commit 21c2bc0
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 59 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ my-idx
.settings/
.project
.classpath
.idea/
*.iml
dependency-reduced-pom.xml
4 changes: 1 addition & 3 deletions bin/build_sample_index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ bin=`cd "$bin"; pwd`

lib=$bin/../target/lib
dist=$bin/../target
classes=$bin/../target/test-classes

HEAP_OPTS="-Xmx1g -Xms1g -XX:NewSize=256m"
JAVA_OPTS="-server -d64"

MAIN_CLASS="com.senseidb.clue.test.BuildSampleIndex"
CLASSPATH=$resources/:$classes/:$lib/*:$dist/*:$1/ext/*

java $JAVA_OPTS $JMX_OPTS $HEAP_OPTS -classpath $CLASSPATH $MAIN_CLASS $bin/../src/test/resources/cars.json $@
java $JAVA_OPTS $JMX_OPTS $HEAP_OPTS -cp $dist/clue-6.2.0-0.0.1-SNAPSHOT.jar $MAIN_CLASS $bin/../src/main/resources/cars.json $@
5 changes: 1 addition & 4 deletions bin/clue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ HEAP_OPTS="-Xmx1g -Xms1g -XX:NewSize=256m"
JAVA_OPTS="-server -d64 -Dhadoop.conf.dir=$HADOOP_CONF_DIR"
#JAVA_DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=y"

MAIN_CLASS="com.senseidb.clue.ClueApplication"
CLASSPATH=$CLASSPATH:$resources/:$lib/*:$dist/*

(cd $bin/..; java $JAVA_OPTS $JAVA_DEBUG $HEAP_OPTS -classpath $CLASSPATH $MAIN_CLASS $@)
(cd $bin/..; java $JAVA_OPTS $JAVA_DEBUG $HEAP_OPTS -jar $dist/clue-6.2.0-0.0.1-SNAPSHOT.jar $@)

98 changes: 46 additions & 52 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>0.0.7-SNAPSHOT</version>
<version>6.2.0-0.0.1-SNAPSHOT</version>
<description>command line client for Apache Lucene</description>

<url>http://github.com/javasoze/clue</url>
Expand All @@ -32,6 +32,12 @@
<email>[email protected]</email>
</developer>
</developers>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mainClass>com.senseidb.clue.ClueApplication</mainClass>
<lucene.version>6.2.0</lucene.version>
</properties>

<!-- Set the compiler to java6 -->
<build>
Expand All @@ -40,62 +46,46 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<outputDirectory>${project.build.directory}/releases/</outputDirectory>
<finalName>clue-all-${project.version}</finalName>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.senseidb.clue.ClueApplication</mainClass>
<packageName>com.senseidb.clue</packageName>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</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>
<!-- exclude signed Manifests -->
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<lucene.version>6.2.0</lucene.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.lucene</groupId>
Expand All @@ -107,6 +97,11 @@
<artifactId>lucene-codecs</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-backward-codecs</artifactId>
<version>${lucene.version}</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queries</artifactId>
Expand Down Expand Up @@ -164,7 +159,6 @@
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20140107</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jline</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ static Document buildDoc(JSONObject json) throws Exception{
public static void main(String[] args) throws Exception{
if (args.length != 2) {
System.out.println("usage: source_file index_dir");
System.exit(1);
}
File f = new File(args[0]);
BufferedReader reader = new BufferedReader(new FileReader(f));
Expand Down
File renamed without changes.

0 comments on commit 21c2bc0

Please sign in to comment.