You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by bi...@apache.org on 2017/02/10 03:50:50 UTC

kylin git commit: KYLIN-2428 extract tool into tool-assembly

Repository: kylin
Updated Branches:
  refs/heads/KYLIN-2428 8eeb7a757 -> 8030a2727


KYLIN-2428 extract tool into tool-assembly


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/8030a272
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/8030a272
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/8030a272

Branch: refs/heads/KYLIN-2428
Commit: 8030a2727adfda2f3d7be125c0eb87dbacf29105
Parents: 8eeb7a7
Author: Billy Liu <bi...@apache.org>
Authored: Fri Feb 10 11:50:09 2017 +0800
Committer: Billy Liu <bi...@apache.org>
Committed: Fri Feb 10 11:50:09 2017 +0800

----------------------------------------------------------------------
 build/bin/get-properties.sh  |   3 +-
 build/bin/kylin.sh           |   6 +-
 build/script/prepare_libs.sh |   2 +-
 pom.xml                      |   6 ++
 tool-assembly/pom.xml        | 135 ++++++++++++++++++++++++++++++++++++++
 tool/pom.xml                 |  98 ---------------------------
 6 files changed, 147 insertions(+), 103 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/8030a272/build/bin/get-properties.sh
----------------------------------------------------------------------
diff --git a/build/bin/get-properties.sh b/build/bin/get-properties.sh
index d6ebc2e..57721d8 100755
--- a/build/bin/get-properties.sh
+++ b/build/bin/get-properties.sh
@@ -25,7 +25,6 @@ then
     exit -1
 fi
 
-job_jar=$(ls $KYLIN_HOME/lib/kylin-job-*.jar)
 tool_jar=$(ls $KYLIN_HOME/tool/kylin-tool-*.jar)
-result=`java -cp $job_jar:$tool_jar -Dlog4j.configuration=file:${KYLIN_HOME}/conf/kylin-tools-log4j.properties org.apache.kylin.tool.KylinConfigCLI $1 2>/dev/null`
+result=`java -cp $tool_jar -Dlog4j.configuration=file:${KYLIN_HOME}/conf/kylin-tools-log4j.properties org.apache.kylin.tool.KylinConfigCLI $1 2>/dev/null`
 echo "$result"

http://git-wip-us.apache.org/repos/asf/kylin/blob/8030a272/build/bin/kylin.sh
----------------------------------------------------------------------
diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh
index d95d4ae..ec2a8b8 100644
--- a/build/bin/kylin.sh
+++ b/build/bin/kylin.sh
@@ -39,7 +39,7 @@ function retrieveDependency() {
     fi
 
     export HBASE_CLASSPATH_PREFIX=${KYLIN_HOME}/conf:${KYLIN_HOME}/lib/*:${KYLIN_HOME}/ext/*:${HBASE_CLASSPATH_PREFIX}
-    export HBASE_CLASSPATH=${HBASE_CLASSPATH}:${hive_dependency}:${KYLIN_HOME}/tool/*
+    export HBASE_CLASSPATH=${HBASE_CLASSPATH}:${hive_dependency}
     if [ -n "$KAFKA_HOME" ]
     then
         source ${dir}/find-kafka-dependency.sh
@@ -169,8 +169,10 @@ then
         then source ${dir}/setenv-tool.sh
     fi
 
+    hbase_original=${HBASE_CLASSPATH}
+    export HBASE_CLASSPATH=${hbase_original}:${KYLIN_HOME}/tool/*
     exec hbase ${KYLIN_EXTRA_START_OPTS} -Dkylin.hive.dependency=${hive_dependency} -Dkylin.hbase.dependency=${hbase_dependency} -Dlog4j.configuration=file:${KYLIN_HOME}/conf/kylin-tools-log4j.properties "$@"
-
+    export HBASE_CLASSPATH=${hbase_original}
 else
     quit "Usage: 'kylin.sh [-v] start' or 'kylin.sh [-v] stop'"
 fi

http://git-wip-us.apache.org/repos/asf/kylin/blob/8030a272/build/script/prepare_libs.sh
----------------------------------------------------------------------
diff --git a/build/script/prepare_libs.sh b/build/script/prepare_libs.sh
index aec9923..3dbdf21 100755
--- a/build/script/prepare_libs.sh
+++ b/build/script/prepare_libs.sh
@@ -33,7 +33,7 @@ mkdir build/lib build/tool
 cp assembly/target/kylin-assembly-${version}-job.jar build/lib/kylin-job-${version}.jar
 cp storage-hbase/target/kylin-storage-hbase-${version}-coprocessor.jar build/lib/kylin-coprocessor-${version}.jar
 cp jdbc/target/kylin-jdbc-${version}.jar build/lib/kylin-jdbc-${version}.jar
-cp tool/target/kylin-tool-${version}-assembly.jar build/tool/kylin-tool-${version}.jar
+cp tool-assembly/target/kylin-tool-assembly-${version}-assembly.jar build/tool/kylin-tool-${version}.jar
 
 # Copied file becomes 000 for some env (e.g. my Cygwin)
 chmod 644 build/lib/kylin-job-${version}.jar

http://git-wip-us.apache.org/repos/asf/kylin/blob/8030a272/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b109783..68a5372 100644
--- a/pom.xml
+++ b/pom.xml
@@ -282,6 +282,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.kylin</groupId>
+                <artifactId>kylin-tool-assembly</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.kylin</groupId>
                 <artifactId>kylin-it</artifactId>
                 <version>${project.version}</version>
             </dependency>
@@ -1058,6 +1063,7 @@
         <module>jdbc</module>
         <module>assembly</module>
         <module>tool</module>
+        <module>tool-assembly</module>
         <module>kylin-it</module>
         <module>tomcat-ext</module>
     </modules>

http://git-wip-us.apache.org/repos/asf/kylin/blob/8030a272/tool-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/tool-assembly/pom.xml b/tool-assembly/pom.xml
new file mode 100644
index 0000000..67d92d4
--- /dev/null
+++ b/tool-assembly/pom.xml
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>kylin-tool-assembly</artifactId>
+    <name>Apache Kylin - Tool Assembly</name>
+    <packaging>jar</packaging>
+    <description>Apache Kylin - Tool Assembly</description>
+
+    <parent>
+        <artifactId>kylin</artifactId>
+        <groupId>org.apache.kylin</groupId>
+        <version>2.0.0-SNAPSHOT</version>
+    </parent>
+
+    <properties>
+        <shadeBase>org.apache.kylin.tool.shaded</shadeBase>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.kylin</groupId>
+            <artifactId>kylin-tool</artifactId>
+        </dependency>
+
+        <!-- As KylinConfigCLI will be called before Hbase/Hive/Hadoop dependency loaded, has to define the following as compile in tool -->
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-lang</groupId>
+            <artifactId>commons-lang</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <shadedArtifactAttached>true</shadedArtifactAttached>
+                            <shadedClassifierName>assembly</shadedClassifierName>
+                            <artifactSet>
+                                <includes>
+                                    <!-- shade the httpcore to avoid the lower version conflict with HBase one -->
+                                    <include>org.apache.httpcomponents:httpcore</include>
+                                    <include>org.slf4j:slf4j-api</include>
+                                    <include>org.slf4j:slf4j-log4j12</include>
+                                    <include>log4j:log4j</include>
+                                    <include>commons-io:commons-io</include>
+                                    <include>commons-lang:commons-lang</include>
+                                    <include>com.google.guava:guava</include>
+                                    <include>org.apache.kylin:*</include>
+                                </includes>
+                            </artifactSet>
+                            <relocations>
+                                <relocation>
+                                    <pattern>com.google.common</pattern>
+                                    <shadedPattern>${shadeBase}.com.google.common</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.apache.commons.io</pattern>
+                                    <shadedPattern>${shadeBase}.org.apache.commons.io</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.apache.commons.lang</pattern>
+                                    <shadedPattern>${shadeBase}.org.apache.commons.lang</shadedPattern>
+                                </relocation>
+                                <relocation>
+                                    <pattern>org.apache.http</pattern>
+                                    <shadedPattern>${shadeBase}.org.apache.http</shadedPattern>
+                                </relocation>
+                            </relocations>
+                            <filters>
+                                <filter>
+                                    <artifact>*:*</artifact>
+                                    <excludes>
+                                        <exclude>META-INF/*.SF</exclude>
+                                        <exclude>META-INF/*.DSA</exclude>
+                                        <exclude>META-INF/*.RSA</exclude>
+                                    </excludes>
+                                </filter>
+                            </filters>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>

http://git-wip-us.apache.org/repos/asf/kylin/blob/8030a272/tool/pom.xml
----------------------------------------------------------------------
diff --git a/tool/pom.xml b/tool/pom.xml
index 6c1df4f..278c2b8 100644
--- a/tool/pom.xml
+++ b/tool/pom.xml
@@ -32,10 +32,6 @@
         <version>2.0.0-SNAPSHOT</version>
     </parent>
 
-    <properties>
-        <shadeBase>org.apache.kylin.tool.shaded</shadeBase>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.kylin</groupId>
@@ -58,33 +54,6 @@
             <artifactId>kylin-source-hive</artifactId>
         </dependency>
 
-        <!-- As KylinConfigCLI will be called before any dependency loaded, has to define the following as compile in tool -->
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>commons-lang</groupId>
-            <artifactId>commons-lang</artifactId>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <scope>compile</scope>
-        </dependency>
-
         <!--Env-->
         <dependency>
             <groupId>org.apache.hbase</groupId>
@@ -112,71 +81,4 @@
 
     </dependencies>
 
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-shade-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>shade</goal>
-                        </goals>
-                        <configuration>
-                            <shadedArtifactAttached>true</shadedArtifactAttached>
-                            <shadedClassifierName>assembly</shadedClassifierName>
-                            <artifactSet>
-                                <includes>
-                                    <!-- shade the httpcore to avoid the lower version conflict with HBase one -->
-                                    <include>org.apache.httpcomponents:httpcore</include>
-                                    <include>org.slf4j:slf4j-api</include>
-                                    <include>org.slf4j:slf4j-log4j12</include>
-                                    <include>log4j:log4j</include>
-                                    <include>commons-io:commons-io</include>
-                                    <include>commons-lang:commons-lang</include>
-                                    <include>com.google.guava:guava</include>
-                                    <include>org.apache.kylin:kylin-tool</include>
-                                </includes>
-                            </artifactSet>
-                            <relocations>
-                                <relocation>
-                                    <pattern>com.google.common</pattern>
-                                    <shadedPattern>${shadeBase}.com.google.common</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.commons.io</pattern>
-                                    <shadedPattern>${shadeBase}.org.apache.commons.io</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.commons.lang</pattern>
-                                    <shadedPattern>${shadeBase}.org.apache.commons.lang</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.http</pattern>
-                                    <shadedPattern>${shadeBase}.org.apache.http</shadedPattern>
-                                </relocation>
-                                <relocation>
-                                    <pattern>org.apache.log4j</pattern>
-                                    <shadedPattern>${shadeBase}.org.apache.log4j</shadedPattern>
-                                </relocation>
-                            </relocations>
-                            <filters>
-                                <filter>
-                                    <artifact>*:*</artifact>
-                                    <excludes>
-                                        <exclude>META-INF/*.SF</exclude>
-                                        <exclude>META-INF/*.DSA</exclude>
-                                        <exclude>META-INF/*.RSA</exclude>
-                                    </excludes>
-                                </filter>
-                            </filters>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
 </project>