-
Notifications
You must be signed in to change notification settings - Fork 3
/
copy-jars.sh
executable file
·69 lines (56 loc) · 1.93 KB
/
copy-jars.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if [ $# -lt 1 ];
then
echo "USAGE: $0 dir"
exit 1
fi
base_dir=$(dirname $0)/../..
hadoop=${HADOOP_HOME}/bin/hadoop
echo "$hadoop fs -rmr $1"
$hadoop fs -rmr $1
echo "$hadoop fs -mkdir $1"
$hadoop fs -mkdir $1
# include kafka jars
for file in $base_dir/contrib/hadoop-consumer/target/scala_2.8.0/*.jar;
do
echo "$hadoop fs -put $file $1/"
$hadoop fs -put $file $1/
done
# include kafka jars
echo "$hadoop fs -put $base_dir/core/target/scala_2.8.0/kafka-*.jar; $1/"
$hadoop fs -put $base_dir/core/target/scala_2.8.0/kafka-*.jar $1/
# include core lib jars
for file in $base_dir/core/lib/*.jar;
do
echo "$hadoop fs -put $file $1/"
$hadoop fs -put $file $1/
done
for file in $base_dir/core/lib_managed/scala_2.8.0/compile/*.jar;
do
echo "$hadoop fs -put $file $1/"
$hadoop fs -put $file $1/
done
# include scala library jar
echo "$hadoop fs -put $base_dir/project/boot/scala-2.8.0/lib/scala-library.jar; $1/"
$hadoop fs -put $base_dir/project/boot/scala-2.8.0/lib/scala-library.jar $1/
local_dir=$(dirname $0)
# include hadoop-consumer jars
for file in $local_dir/lib/*.jar;
do
echo "$hadoop fs -put $file $1/"
$hadoop fs -put $file $1/
done