Skip to content

Commit 3390bb3

Browse files
committed
FatJar works with just Java now
1 parent 546bb67 commit 3390bb3

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ Build jar from source with
66
```
77
and find the output JAR file as `build/libs/restructurehdfs-all-0.1-SNAPSHOT.jar`. Then run with:
88
```
9-
hadoop jar restructurehdfs-all-0.1-SNAPSHOT.jar <webhdfs_url> <hdfs_topic_path> <output_folder>
9+
java -jar restructurehdfs-all-0.1-SNAPSHOT.jar <webhdfs_url> <hdfs_topic_path> <output_folder>
1010
```

build.gradle

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,20 @@ dependencies {
3030

3131
//create a single Jar with all dependencies
3232
task fatJar(type: Jar) {
33+
dependsOn configurations.runtime
3334
manifest {
3435
attributes 'Implementation-Title': 'radar-restructure-hdfs',
3536
'Implementation-Version': version,
3637
'Main-Class': mainClassName
3738
}
3839
baseName = project.name + '-all'
39-
from { configurations.runtime.collect {
40-
it.isDirectory() ? it : zipTree(it).matching{ exclude { it.path.contains('META-INF') } }
41-
} }
40+
from {
41+
configurations.runtime.collect {
42+
it.isDirectory() ? it : zipTree(it)
43+
}
44+
} {
45+
exclude 'META-INF/*'
46+
}
4247
with jar
4348
}
4449

src/main/java/org/radarcns/RestructureAvroRecords.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ public static void main(String [] args) throws Exception {
5757
long time1 = System.currentTimeMillis();
5858

5959
RestructureAvroRecords restr = new RestructureAvroRecords(args[0], args[2]);
60-
restr.start(args[1]);
60+
try {
61+
restr.start(args[1]);
62+
} catch (IOException ex) {
63+
logger.error("Processing failed", ex);
64+
}
6165

6266
logger.info("Processed %d files and %,d records", restr.getProcessedFileCount(), restr.getProcessedRecordsCount());
6367
logger.info("Time taken: %.2f seconds", (System.currentTimeMillis() - time1)/1000d);

0 commit comments

Comments
 (0)