Skip to content

Commit a610722

Browse files
committed
Updated build
1 parent 959d80f commit a610722

File tree

3 files changed

+31
-14
lines changed

3 files changed

+31
-14
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,4 @@ modules.xml
100100

101101
## Pebble 2
102102
.lock*
103+
/data/

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
Build jar from source and run with:
1+
# Restructure HDFS files
2+
3+
Build jar from source with
24
```
3-
hadoop jar restructurehdfs-all-0.1.0.jar <webhdfs_url> <hdfs_topic> <output_folder>
5+
./gradlew fatJar
6+
```
7+
and find the output JAR file as `build/libs/restructurehdfs-all-0.1-SNAPSHOT.jar`. Then run with:
8+
```
9+
hadoop jar restructurehdfs-all-0.1.0.jar <webhdfs_url> <hdfs_topic_path> <output_folder>
410
```

build.gradle

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,44 @@
1+
apply plugin: 'java'
2+
apply plugin: 'application'
3+
14
group 'org.radarcns.restructurehdfs'
2-
version '1.0-SNAPSHOT'
5+
version '0.1-SNAPSHOT'
6+
mainClassName = 'org.radarcns.RestructureAvroRecords'
37

4-
apply plugin: 'java'
5-
version = '0.1.0'
8+
run {
9+
args = ['webhdfs://radar-test.thehyve.net:50070', '/topicAndroidPhoneNew/android_phone_sensor_acceleration', "${projectDir}/data"]
10+
}
611

712
sourceCompatibility = 1.8
13+
targetCompatibility = 1.8
814

915
repositories {
10-
mavenCentral()
16+
jcenter()
1117
}
1218

1319
dependencies {
14-
testCompile group: 'junit', name: 'junit', version: '4.11'
15-
compile 'org.apache.logging.log4j:log4j-core:2.8.1'
1620
compile 'org.apache.hadoop:hadoop-common:2.7.3'
21+
compile 'org.apache.avro:avro:1.8.1'
22+
compile 'org.apache.avro:avro-mapred:1.8.1'
23+
24+
runtime 'org.apache.logging.log4j:log4j-core:2.8.1'
25+
runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.8.1'
1726
runtime 'org.apache.hadoop:hadoop-hdfs:2.7.3'
18-
compile 'org.apache.avro:avro:1.7.7'
19-
compile 'org.apache.avro:avro-mapred:1.7.7'
20-
compile 'com.fasterxml.jackson.core:jackson-core:2.8.7'
27+
28+
testCompile group: 'junit', name: 'junit', version: '4.11'
2129
}
2230

2331
//create a single Jar with all dependencies
2432
task fatJar(type: Jar) {
2533
manifest {
26-
attributes 'Implementation-Title': 'Gradle Jar File Example',
34+
attributes 'Implementation-Title': 'radar-restructure-hdfs',
2735
'Implementation-Version': version,
28-
'Main-Class': 'org.radarcns.RestructureAvroRecords'
36+
'Main-Class': mainClassName
2937
}
3038
baseName = project.name + '-all'
31-
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
39+
from { configurations.runtime.collect {
40+
it.isDirectory() ? it : zipTree(it).matching{ exclude { it.path.contains('META-INF') } }
41+
} }
3242
with jar
3343
}
3444

0 commit comments

Comments
 (0)