Saturday, December 6, 2014

GitHub Projects that are written in Java and do not have any JAR files to download

In this case I’ll do it with the Hadoop filecrush project here: http://ift.tt/1gzGOis


There are no JAR files to download.


What do you do?


You build it :)


How?


Look for pom.xml. That means it can all be built by maven. Here’s how to do that:


1. install Java Development Kit (Open-JDK in this case)

– yum install java-1.7.0-openjdk-devel (the “-devel” includes the actual JDK… the version without “-devel” doesn’t have the JDK… despite the name)

– I found that by first going “yum list *jdk* and looking through what it displays

– set JAVA_HOME environment variable

– export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.71.x86_64/jre


2. install wget

– yum install wget


2. install maven

– Maven is not in the yum repository, so we’re going to just follow the directions from the Maven site: http://ift.tt/1j5lN1M

– wget http://ift.tt/12xh1qc

– tar xzf apache-maven-3.2.3-bin.tar.gz -C /usr/local/

– cd /usr/local

– export M2_HOME=/usr/local/apache-maven-3.2.3/

– export PATH=${M2_HOME}/bin:${PATH}

– “mvn -version” to make sure it’s installed

– you should see no error messages


3. Download the filecrush project:

– wget http://ift.tt/1wKXqR5


4. Install unzip

– yum install unzip


5. decompress project

– unzip master.zip


6. Run Maven to build the project

– cd filecrush-master

– mvn package

– it’ll download a bunch of stuff now

– “mvn package” automatically looks for a “pom.xml” file, since that file contains all the build instructions.

– “mvn package” produces a JAR file, whereas “mvn install” would install the files somewhere on the system.

– hmm… seems to throw exceptions… looking for error about “Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project filecrush: There are test failures.”


7. Found something: http://ift.tt/1uM35ml

– this is someone reporting what appears to be this very error

– The filecrush author says it looks to be a non-deterministic problem that we can safely ignore with the following build command:

– mvn -Dmaven.test.skip=true package

– there we go. Seems to build fine


8. Get built JAR

– the file at target/filecrush-2.2.2-SNAPSHOT.jar





No comments:

Post a Comment