I am trying to use Cascading in my Hadoop project. I am trying to implement the first example given in the book Enterprise Data Workflows with Cascading . I wrote a java class that contains Cascading related code, and I have another build.graddle file that should compile this Java class and create a jar file from it.
My folder structure is as follows:
My build.gradle file is as follows:
apply plugin: 'java' apply plugin: 'idea' apply plugin: 'eclipse' archivesBaseName = 'impatient' repositories { mavenLocal() mavenCentral() mavenRepo name: 'conjars', url: 'http://conjars.org/repo/' } ext.cascadingVersion = '2.1.0' dependencies { compile( group: 'cascading', name: 'cascading-core', version: cascadingVersion ) compile( group: 'cascading', name: 'cascading-hadoop', version: cascadingVersion ) } jar { description = "Assembles a Hadoop ready jar file" doFirst { into( 'lib' ) { from configurations.compile } } manifest { attributes( "Main-Class": "impatient/Main" ) } }
When I run the gradle clean jar command from the command line, I get a successful build message. I tried to run this jar file using
hadoop jar impatient.jar <input file path> <output file path>
but then it gives me an Exception in thread "main" java.lang.ClassNotFoundException: impatient.Main exception.
So, I checked the contents of the jar file and found that this jar does not contain the impatient/Main.class .
Please note that I do not know anything about gradle .
Ask someone to tell me if something is wrong with the gradle script or I am wrong.
Thanks!!!
source share