You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by cd...@apache.org on 2019/08/05 12:41:39 UTC

[incubator-iotdb] 01/01: - Nothing is built outside the target directory anymore o I moved the static parts of the client and server distributions to “src/assembly/resources” and added an assembly that builds the client and server inside the target directory (You need to update the documentation on this) o The sever is now available at server/target/iotdb-server-0.9.0-SNAPSHOT o The client is now available at client/target/iotdb-client-0.9.0-SNAPSHOT o I updated the integration tests to work with these new loc [...]

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/clean-up-maven-build
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit 9b355955ed7d3fb8886428755366ec7a2beac44f
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Aug 5 14:41:25 2019 +0200

    -	Nothing is built outside the target directory anymore
    o	I moved the static parts of the client and server distributions to “src/assembly/resources” and added an assembly that builds the client and server inside the target directory (You need to update the documentation on this)
    o	The sever is now available at server/target/iotdb-server-0.9.0-SNAPSHOT
    o	The client is now available at client/target/iotdb-client-0.9.0-SNAPSHOT
    o	I updated the integration tests to work with these new locations
    -	I updated the distribution module (binary-distribution) to simply include and unpack the client and server assemblies, which greatly simplifies the assembly itself.
    -	In the integration-tests you use a process builder to get the current working directory … you can access this in the “user.dir” System property.
    -	There was a large mixture of artifacts with different versions in the classpath.
    o	I set all versions to the same using a big dependencyManagement block in the master pom
    o	I removed the version of every external dependency and moved it into the main dependencyManagement block in the root pom (except dependencies only used in the examples, for these I added a dependencyManagement block in the example pom). This way you instantly identify external dependencies.
    o	I added an enforcer rule to fail the build if two differing versions of one artifact are being used in the build (This should eliminate this problem from re-occuring)
    o	I replaced the usage of “${project.version}” with the real version (There is no need to manually update these versions and this way when looking at the pom you instantly know the version … keep in mind if an artifact is deployed to maven central, the user doesn’t have the code and therefore he always has to scroll up to the top in order to see which version is used)
    -	There were some imports related to Jdk 11 no longer providing some APIs, I moved those imports to a maven profile, which is activated based on the JDK version
    -	HDFSInputTest created a file in “spark/test/” … if the test failed, the rat plugin would complain the next time it’s run.
    
    I checked the build with all tests on Oracle-Java 8, Open-JDK 11, Oracle-JDK 12.
---
 .gitignore                                         |   1 -
 client/pom.xml                                     |  65 ++--
 .../src/assembly/client.xml                        |  20 +-
 .../assembly/resources}/sbin/start-client.bat      |   0
 .../assembly/resources}/sbin/start-client.sh       |   0
 .../assembly/resources}/tools/export-csv.bat       |   0
 .../assembly/resources}/tools/export-csv.sh        |   0
 .../assembly/resources}/tools/import-csv.bat       |   0
 .../assembly/resources}/tools/import-csv.sh        |   0
 .../apache/iotdb/cli/client/AbstractScript.java    |  29 +-
 .../iotdb/cli/client/StartClientScriptIT.java      |   8 +-
 .../org/apache/iotdb/cli/tool/ExportCsvTestIT.java |   8 +-
 .../org/apache/iotdb/cli/tool/ImportCsvTestIT.java |   8 +-
 distribution/pom.xml                               |  14 +
 distribution/src/assembly/distribution.xml         |  40 +--
 example/kafka/pom.xml                              |  24 +-
 example/pom.xml                                    |  51 ++-
 example/rocketmq/pom.xml                           |  14 +-
 grafana/pom.xml                                    |   2 +-
 hadoop/pom.xml                                     |   6 +-
 jdbc/pom.xml                                       |  15 +-
 pom.xml                                            | 386 +++++++++++++++++++--
 server/pom.xml                                     |  85 ++---
 .../resources}/conf/iotdb-engine.properties        |   0
 .../assembly/resources}/conf/iotdb-env.bat         |   0
 .../assembly/resources}/conf/iotdb-env.sh          |   0
 .../resources}/conf/iotdb-sync-client.properties   |   0
 .../assembly/resources}/conf/logback-tool.xml      |   0
 .../assembly/resources}/conf/logback.xml           |   0
 .../resources}/conf/tsfile-format.properties       |   0
 .../assembly/resources}/sbin/start-server.bat      |   0
 .../assembly/resources}/sbin/start-server.sh       |   0
 .../assembly/resources}/sbin/stop-server.bat       |   0
 .../assembly/resources}/sbin/stop-server.sh        |   0
 .../assembly/resources}/tools/memory-tool.bat      |   0
 .../assembly/resources}/tools/memory-tool.sh       |   0
 .../assembly/resources}/tools/start-WalChecker.bat |   0
 .../assembly/resources}/tools/start-WalChecker.sh  |   0
 .../resources}/tools/start-sync-client.bat         |   0
 .../assembly/resources}/tools/start-sync-client.sh |   0
 .../assembly/resources}/tools/stop-sync-client.bat |   0
 .../assembly/resources}/tools/stop-sync-client.sh  |   0
 .../logback-tool.xml => src/assembly/server.xml}   |  20 +-
 .../org/apache/iotdb/db/script/EnvScriptIT.java    |  34 +-
 spark-tsfile/pom.xml                               |  32 +-
 .../org/apache/iotdb/tsfile/HDFSInputTest.java     |   2 +-
 tsfile/pom.xml                                     |   3 -
 47 files changed, 597 insertions(+), 270 deletions(-)

diff --git a/.gitignore b/.gitignore
index f74fb7f..f50cc97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,7 +4,6 @@
 **/lib/**
 **/data/**
 
-tsfile/src/test/resources/perTestInputData
 # Eclipse IDE files
 **/.classpath
 **/.project
diff --git a/client/pom.xml b/client/pom.xml
index 7849697..07da5c6 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -31,8 +31,6 @@
     <name>IoTDB Client</name>
     <description>A Client tool.</description>
     <properties>
-        <common.cli.version>1.3.1</common.cli.version>
-        <jline.version>2.14.5</jline.version>
         <cli.test.skip>false</cli.test.skip>
         <cli.it.skip>${cli.test.skip}</cli.it.skip>
         <cli.ut.skip>${cli.test.skip}</cli.ut.skip>
@@ -41,68 +39,27 @@
         <dependency>
             <groupId>org.apache.iotdb</groupId>
             <artifactId>iotdb-jdbc</artifactId>
-            <version>${project.version}</version>
+            <version>0.9.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>commons-cli</groupId>
             <artifactId>commons-cli</artifactId>
-            <version>${common.cli.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
-            <version>3.1</version>
         </dependency>
         <dependency>
             <groupId>me.tongfei</groupId>
             <artifactId>progressbar</artifactId>
-            <version>0.7.3</version>
         </dependency>
         <dependency>
             <groupId>jline</groupId>
             <artifactId>jline</artifactId>
-            <version>${jline.version}</version>
         </dependency>
     </dependencies>
     <build>
         <plugins>
-            <plugin>
-                <artifactId>maven-clean-plugin</artifactId>
-                <configuration>
-                    <filesets>
-                        <fileset>
-                            <directory>${project.basedir}/cli/lib</directory>
-                            <includes>
-                                <include>**/*.jar</include>
-                            </includes>
-                            <followSymlinks>false</followSymlinks>
-                        </fileset>
-                    </filesets>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>copy-dependencies</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>copy-dependencies</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${project.basedir}/cli/lib</outputDirectory>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <configuration>
-                    <outputDirectory>${project.basedir}/cli/lib</outputDirectory>
-                </configuration>
-            </plugin>
             <!--using `mvn test` to run UT, `mvn verify` to run ITs
             Reference: https://antoniogoncalves.org/2012/12/13/lets-turn-integration-tests-with-maven-to-a-first-class-citizen/-->
             <plugin>
@@ -130,6 +87,26 @@
                     <skipITs>${cli.it.skip}</skipITs>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <!-- Package binaries-->
+                    <execution>
+                        <id>client-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <descriptors>
+                                <descriptor>src/assembly/client.xml</descriptor>
+                            </descriptors>
+                            <appendAssemblyId>false</appendAssemblyId>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
     <profiles>
diff --git a/server/iotdb/conf/logback-tool.xml b/client/src/assembly/client.xml
similarity index 63%
copy from server/iotdb/conf/logback-tool.xml
copy to client/src/assembly/client.xml
index 98f3f9d..f02a281 100644
--- a/server/iotdb/conf/logback-tool.xml
+++ b/client/src/assembly/client.xml
@@ -19,4 +19,22 @@
     under the License.
 
 -->
-<configuration/>
+<assembly>
+    <id>client</id>
+    <formats>
+        <format>dir</format>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>lib</outputDirectory>
+        </dependencySet>
+    </dependencySets>
+    <fileSets>
+        <fileSet>
+            <directory>src/assembly/resources</directory>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>
diff --git a/client/cli/sbin/start-client.bat b/client/src/assembly/resources/sbin/start-client.bat
similarity index 100%
rename from client/cli/sbin/start-client.bat
rename to client/src/assembly/resources/sbin/start-client.bat
diff --git a/client/cli/sbin/start-client.sh b/client/src/assembly/resources/sbin/start-client.sh
similarity index 100%
rename from client/cli/sbin/start-client.sh
rename to client/src/assembly/resources/sbin/start-client.sh
diff --git a/client/cli/tools/export-csv.bat b/client/src/assembly/resources/tools/export-csv.bat
similarity index 100%
rename from client/cli/tools/export-csv.bat
rename to client/src/assembly/resources/tools/export-csv.bat
diff --git a/client/cli/tools/export-csv.sh b/client/src/assembly/resources/tools/export-csv.sh
similarity index 100%
rename from client/cli/tools/export-csv.sh
rename to client/src/assembly/resources/tools/export-csv.sh
diff --git a/client/cli/tools/import-csv.bat b/client/src/assembly/resources/tools/import-csv.bat
similarity index 100%
rename from client/cli/tools/import-csv.bat
rename to client/src/assembly/resources/tools/import-csv.bat
diff --git a/client/cli/tools/import-csv.sh b/client/src/assembly/resources/tools/import-csv.sh
similarity index 100%
rename from client/cli/tools/import-csv.sh
rename to client/src/assembly/resources/tools/import-csv.sh
diff --git a/client/src/test/java/org/apache/iotdb/cli/client/AbstractScript.java b/client/src/test/java/org/apache/iotdb/cli/client/AbstractScript.java
index 4ca8c33..4cd1a40 100644
--- a/client/src/test/java/org/apache/iotdb/cli/client/AbstractScript.java
+++ b/client/src/test/java/org/apache/iotdb/cli/client/AbstractScript.java
@@ -20,9 +20,7 @@ package org.apache.iotdb.cli.client;
 
 import static org.junit.Assert.assertEquals;
 
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
+import java.io.*;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -50,13 +48,24 @@ public abstract class AbstractScript {
     }
   }
 
-  protected String getCurrentPath(String... command) throws IOException {
-    ProcessBuilder builder = new ProcessBuilder(command);
-    builder.redirectErrorStream(true);
-    Process p = builder.start();
-    BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
-    String path = r.readLine();
-    return path;
+  protected String getCliPath() {
+    // This is usually always set by the JVM
+    File userDir = new File(System.getProperty("user.dir"));
+    if(!userDir.exists()) {
+      throw new RuntimeException("user.dir " + userDir.getAbsolutePath() + " doesn't exist.");
+    }
+    File targetDir = new File(userDir, "target");
+    File[] files = targetDir.listFiles(new FileFilter() {
+      @Override
+      public boolean accept(File pathname) {
+        return pathname.isDirectory() && pathname.getName().startsWith("iotdb-client-");
+      }
+    });
+    if(files.length != 1) {
+      throw new RuntimeException(
+              "Exactly one directory starting with 'iotdb-client-' should have been found, but was " + files.length);
+    }
+    return files[0].getAbsolutePath();
   }
 
   protected abstract void testOnWindows() throws IOException;
diff --git a/client/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java b/client/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java
index 55033a2..e4ed965 100644
--- a/client/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java
+++ b/client/src/test/java/org/apache/iotdb/cli/client/StartClientScriptIT.java
@@ -50,9 +50,9 @@ public class StartClientScriptIT extends AbstractScript {
     final String[] output = {"````````````````````````", "Starting IoTDB Client",
         "````````````````````````",
         "IoTDB> Connection Error, please check whether the network is available or the server has started. Host is 127.0.0.1, port is 6668."};
-    String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%");
+    String dir = getCliPath();
     ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c",
-        dir + File.separator + "cli" + File.separator + "sbin" + File.separator + "start-client.bat",
+        dir + File.separator + "sbin" + File.separator + "start-client.bat",
         "-h",
         "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root");
     testOutput(builder, output);
@@ -63,9 +63,9 @@ public class StartClientScriptIT extends AbstractScript {
     final String[] output = {"---------------------", "Starting IoTDB Client",
         "---------------------",
         "IoTDB> Connection Error, please check whether the network is available or the server has started. Host is 127.0.0.1, port is 6668."};
-    String dir = getCurrentPath("pwd");
+    String dir = getCliPath();
     ProcessBuilder builder = new ProcessBuilder("sh",
-        dir + File.separator + "cli" + File.separator + "sbin" + File.separator + "start-client.sh",
+        dir + File.separator + "sbin" + File.separator + "start-client.sh",
         "-h",
         "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root");
     testOutput(builder, output);
diff --git a/client/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java b/client/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java
index 1836df0..de30750 100644
--- a/client/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java
+++ b/client/src/test/java/org/apache/iotdb/cli/tool/ExportCsvTestIT.java
@@ -52,9 +52,9 @@ public class ExportCsvTestIT extends AbstractScript{
         "````````````````````````````````````````````````",
         "Encounter an error when exporting data, error is: Connection Error, "
             + "please check whether the network is available or the server has started."};
-    String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%");
+    String dir = getCliPath();
     ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c",
-        dir + File.separator + "cli" + File.separator + "tools" + File.separator + "export-csv.bat",
+        dir + File.separator + "tools" + File.separator + "export-csv.bat",
         "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root", "-td", "./");
     testOutput(builder, output);
   }
@@ -66,9 +66,9 @@ public class ExportCsvTestIT extends AbstractScript{
         "------------------------------------------",
         "Encounter an error when exporting data, error is: Connection Error, "
             + "please check whether the network is available or the server has started."};
-    String dir = getCurrentPath("pwd");
+    String dir = getCliPath();
     ProcessBuilder builder = new ProcessBuilder("sh",
-        dir + File.separator + "cli" + File.separator + "tools" + File.separator + "export-csv.sh",
+        dir + File.separator + "tools" + File.separator + "export-csv.sh",
         "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root", "-td", "./");
     testOutput(builder, output);
   }
diff --git a/client/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java b/client/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java
index 755c8df..8bbe91b 100644
--- a/client/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java
+++ b/client/src/test/java/org/apache/iotdb/cli/tool/ImportCsvTestIT.java
@@ -52,9 +52,9 @@ public class ImportCsvTestIT extends AbstractScript {
         "````````````````````````````````````````````````",
         "Encounter an error when importing data, error is: Connection Error, please check whether "
             + "the network is available or the server has started."};
-    String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%");
+    String dir = getCliPath();
     ProcessBuilder builder = new ProcessBuilder("cmd.exe", "/c",
-        dir + File.separator + "cli" + File.separator + "tools" + File.separator + "import-csv.bat",
+        dir + File.separator + "tools" + File.separator + "import-csv.bat",
         "-h", "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root", "-f", "./");
     testOutput(builder, output);
   }
@@ -66,9 +66,9 @@ public class ImportCsvTestIT extends AbstractScript {
         "------------------------------------------",
         "Encounter an error when importing data, error is: Connection Error, please check whether "
             + "the network is available or the server has started."};
-    String dir = getCurrentPath("pwd");
+    String dir = getCliPath();
     ProcessBuilder builder = new ProcessBuilder("sh",
-        dir + File.separator + "cli" + File.separator + "tools" + File.separator + "import-csv.sh",
+        dir + File.separator + "tools" + File.separator + "import-csv.sh",
         "-h",
         "127.0.0.1", "-p", "6668", "-u", "root", "-pw", "root", "-f", "./");
     testOutput(builder, output);
diff --git a/distribution/pom.xml b/distribution/pom.xml
index 4aaceb1..8b737a2 100644
--- a/distribution/pom.xml
+++ b/distribution/pom.xml
@@ -83,4 +83,18 @@
             </plugin>
         </plugins>
     </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-server</artifactId>
+            <version>0.9.0-SNAPSHOT</version>
+            <type>zip</type>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-client</artifactId>
+            <version>0.9.0-SNAPSHOT</version>
+            <type>zip</type>
+        </dependency>
+    </dependencies>
 </project>
diff --git a/distribution/src/assembly/distribution.xml b/distribution/src/assembly/distribution.xml
index 736b276..b0cfd6f 100644
--- a/distribution/src/assembly/distribution.xml
+++ b/distribution/src/assembly/distribution.xml
@@ -22,23 +22,19 @@
 <assembly>
     <id>bin</id>
     <formats>
+        <format>dir</format>
         <format>zip</format>
     </formats>
     <includeBaseDirectory>true</includeBaseDirectory>
-    <moduleSets>
-        <moduleSet>
-            <!-- Forces the assembly module to be moved to the end of the build -->
-            <useAllReactorProjects>true</useAllReactorProjects>
+    <dependencySets>
+        <dependencySet>
             <includes>
-                <include>org.apache.iotdb:iotdb-server</include>
-                <include>org.apache.iotdb:iotdb-client</include>
+                <include>*:zip:*</include>
             </includes>
-            <binaries>
-                <outputDirectory>lib</outputDirectory>
-                <unpack>false</unpack>
-            </binaries>
-        </moduleSet>
-    </moduleSets>
+            <outputDirectory>/</outputDirectory>
+            <unpack>true</unpack>
+        </dependencySet>
+    </dependencySets>
     <files>
         <file>
             <source>${maven.multiModuleProjectDirectory}/README.md</source>
@@ -67,25 +63,5 @@
             <directory>${maven.multiModuleProjectDirectory}/docs</directory>
             <outputDirectory>docs</outputDirectory>
         </fileSet>
-        <fileSet>
-            <directory>${maven.multiModuleProjectDirectory}/server/iotdb/conf</directory>
-            <outputDirectory>conf</outputDirectory>
-        </fileSet>
-        <fileSet>
-            <directory>${maven.multiModuleProjectDirectory}/server/iotdb/sbin</directory>
-            <outputDirectory>sbin</outputDirectory>
-        </fileSet>
-        <fileSet>
-            <directory>${maven.multiModuleProjectDirectory}/client/cli/sbin</directory>
-            <outputDirectory>sbin</outputDirectory>
-        </fileSet>
-        <fileSet>
-            <directory>${maven.multiModuleProjectDirectory}/server/iotdb/tools</directory>
-            <outputDirectory>tools</outputDirectory>
-        </fileSet>
-        <fileSet>
-            <directory>${maven.multiModuleProjectDirectory}/client/cli/tools</directory>
-            <outputDirectory>tools</outputDirectory>
-        </fileSet>
     </fileSets>
 </assembly>
diff --git a/example/kafka/pom.xml b/example/kafka/pom.xml
index b7879eb..a332987 100644
--- a/example/kafka/pom.xml
+++ b/example/kafka/pom.xml
@@ -39,33 +39,11 @@
         <dependency>
             <groupId>org.apache.iotdb</groupId>
             <artifactId>iotdb-jdbc</artifactId>
+            <version>0.9.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.kafka</groupId>
             <artifactId>kafka_2.10</artifactId>
-            <version>0.8.2.0</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.slf4j</groupId>
-                    <artifactId>slf4j-api</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.slf4j</groupId>
-                    <artifactId>slf4j-log4j12</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
     </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>8</source>
-                    <target>8</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 </project>
diff --git a/example/pom.xml b/example/pom.xml
index 8f5851e..5c191f3 100644
--- a/example/pom.xml
+++ b/example/pom.xml
@@ -30,17 +30,54 @@
     <packaging>pom</packaging>
     <artifactId>iotdb-examples</artifactId>
     <name>IoTDB Examples</name>
+    <properties>
+        <zookeeper.version>3.4.6</zookeeper.version>
+    </properties>
+    <modules>
+        <module>kafka</module>
+        <module>rocketmq</module>
+    </modules>
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <configuration>
+                        <source>8</source>
+                        <target>8</target>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
     <dependencyManagement>
         <dependencies>
             <dependency>
-                <groupId>org.apache.iotdb</groupId>
-                <artifactId>iotdb-jdbc</artifactId>
-                <version>${project.version}</version>
+                <groupId>org.apache.kafka</groupId>
+                <artifactId>kafka_2.10</artifactId>
+                <version>0.8.2.0</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>org.slf4j</groupId>
+                        <artifactId>slf4j-api</artifactId>
+                    </exclusion>
+                    <exclusion>
+                        <groupId>org.slf4j</groupId>
+                        <artifactId>slf4j-log4j12</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.rocketmq</groupId>
+                <artifactId>rocketmq-client</artifactId>
+                <version>4.4.0</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.zookeeper</groupId>
+                <artifactId>zookeeper</artifactId>
+                <version>${zookeeper.version}</version>
             </dependency>
         </dependencies>
     </dependencyManagement>
-    <modules>
-        <module>kafka</module>
-        <module>rocketmq</module>
-    </modules>
 </project>
diff --git a/example/rocketmq/pom.xml b/example/rocketmq/pom.xml
index 4806ff1..0117b30 100644
--- a/example/rocketmq/pom.xml
+++ b/example/rocketmq/pom.xml
@@ -34,23 +34,11 @@
         <dependency>
             <groupId>org.apache.iotdb</groupId>
             <artifactId>iotdb-jdbc</artifactId>
+            <version>0.9.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.rocketmq</groupId>
             <artifactId>rocketmq-client</artifactId>
-            <version>4.4.0</version>
         </dependency>
     </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>8</source>
-                    <target>8</target>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
 </project>
diff --git a/grafana/pom.xml b/grafana/pom.xml
index ba829ff..e472115 100644
--- a/grafana/pom.xml
+++ b/grafana/pom.xml
@@ -61,7 +61,7 @@
         <dependency>
             <groupId>org.apache.iotdb</groupId>
             <artifactId>iotdb-jdbc</artifactId>
-            <version>${project.version}</version>
+            <version>0.9.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
diff --git a/hadoop/pom.xml b/hadoop/pom.xml
index a2a8751..d1cceec 100644
--- a/hadoop/pom.xml
+++ b/hadoop/pom.xml
@@ -36,15 +36,11 @@
         <dependency>
             <groupId>org.apache.iotdb</groupId>
             <artifactId>tsfile</artifactId>
-            <version>${project.version}</version>
+            <version>0.9.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.hadoop</groupId>
             <artifactId>hadoop-client</artifactId>
-            <version>${hadoop.version}</version>
         </dependency>
     </dependencies>
-    <build>
-        <plugins/>
-    </build>
 </project>
diff --git a/jdbc/pom.xml b/jdbc/pom.xml
index c5967a9..4b971d8 100644
--- a/jdbc/pom.xml
+++ b/jdbc/pom.xml
@@ -39,12 +39,12 @@
         <dependency>
             <groupId>org.apache.iotdb</groupId>
             <artifactId>tsfile</artifactId>
-            <version>${project.version}</version>
+            <version>0.9.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.iotdb</groupId>
             <artifactId>service-rpc</artifactId>
-            <version>${project.version}</version>
+            <version>0.9.0-SNAPSHOT</version>
         </dependency>
     </dependencies>
     <build>
@@ -96,17 +96,6 @@
                     <skipITs>${jdbc.it.skip}</skipITs>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.apache.rat</groupId>
-                <artifactId>apache-rat-plugin</artifactId>
-                <configuration>
-                    <excludes>
-                        <exclude>example/data/kafka_data.csv</exclude>
-                        <exclude>**/*.iml</exclude>
-                        <exclude>**/*.log</exclude>
-                    </excludes>
-                </configuration>
-            </plugin>
         </plugins>
     </build>
     <profiles>
diff --git a/pom.xml b/pom.xml
index 917718e..0073930 100644
--- a/pom.xml
+++ b/pom.xml
@@ -60,6 +60,15 @@
         <commons.collections4>4.0</commons.collections4>
         <thrift.version>0.9.3</thrift.version>
         <airline.version>0.8</airline.version>
+        <jackson.version>2.8.8</jackson.version>
+        <antlr3.version>3.5.2</antlr3.version>
+        <common.cli.version>1.3.1</common.cli.version>
+        <common.codec.version>1.13</common.codec.version>
+        <common.collections.version>3.2.2</common.collections.version>
+        <common.lang.version>2.6</common.lang.version>
+        <common.lang3.version>3.8.1</common.lang3.version>
+        <common.logging.version>1.1.3</common.logging.version>
+        <jline.version>2.14.5</jline.version>
         <!-- URL of the ASF SonarQube server -->
         <sonar.host.url>https://builds.apache.org/analysis</sonar.host.url>
         <!-- Exclude all generated code -->
@@ -82,6 +91,259 @@
                 <version>${logback.version}</version>
             </dependency>
             <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>1.2.31</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.core</groupId>
+                <artifactId>jackson-annotations</artifactId>
+                <version>${jackson.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.core</groupId>
+                <artifactId>jackson-core</artifactId>
+                <version>${jackson.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.core</groupId>
+                <artifactId>jackson-databind</artifactId>
+                <version>${jackson.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.module</groupId>
+                <artifactId>jackson-module-paranamer</artifactId>
+                <version>${jackson.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.fasterxml.jackson.module</groupId>
+                <artifactId>jackson-module-scala_2.11</artifactId>
+                <version>${jackson.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>com.google.code.findbugs</groupId>
+                <artifactId>jsr305</artifactId>
+                <version>3.0.2</version>
+            </dependency>
+            <dependency>
+                <groupId>com.google.guava</groupId>
+                <artifactId>guava</artifactId>
+                <version>21.0</version>
+            </dependency>
+            <dependency>
+                <groupId>com.sun.istack</groupId>
+                <artifactId>istack-commons-runtime</artifactId>
+                <version>3.0.8</version>
+            </dependency>
+            <dependency>
+                <groupId>com.sun.xml.fastinfoset</groupId>
+                <artifactId>FastInfoset</artifactId>
+                <version>1.2.16</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-lang</groupId>
+                <artifactId>commons-lang</artifactId>
+                <version>${common.lang.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-cli</groupId>
+                <artifactId>commons-cli</artifactId>
+                <version>${common.cli.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-codec</groupId>
+                <artifactId>commons-codec</artifactId>
+                <version>${common.codec.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-collections</groupId>
+                <artifactId>commons-collections</artifactId>
+                <version>${common.collections.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-io</groupId>
+                <artifactId>commons-io</artifactId>
+                <version>${common.io.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>commons-logging</groupId>
+                <artifactId>commons-logging</artifactId>
+                <version>${common.logging.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>io.netty</groupId>
+                <artifactId>netty</artifactId>
+                <version>3.9.9.Final</version>
+            </dependency>
+            <dependency>
+                <groupId>io.netty</groupId>
+                <artifactId>netty-all</artifactId>
+                <version>4.1.17.Final</version>
+            </dependency>
+            <dependency>
+                <groupId>javax.annotation</groupId>
+                <artifactId>javax.annotation-api</artifactId>
+                <version>1.3.2</version>
+            </dependency>
+            <dependency>
+                <groupId>javax.xml.bind</groupId>
+                <artifactId>jaxb-api</artifactId>
+                <version>2.4.0-b180725.0427</version>
+            </dependency>
+            <dependency>
+                <groupId>jline</groupId>
+                <artifactId>jline</artifactId>
+                <version>${jline.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>junit</groupId>
+                <artifactId>junit</artifactId>
+                <version>${junit.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>log4j</groupId>
+                <artifactId>log4j</artifactId>
+                <version>1.2.17</version>
+            </dependency>
+            <dependency>
+                <groupId>me.tongfei</groupId>
+                <artifactId>progressbar</artifactId>
+                <version>0.7.3</version>
+                <exclusions>
+                    <!-- This transitive dependency duplicates classes from jline:jline:jar:2.14.5:compile -->
+                    <exclusion>
+                        <groupId>org.fusesource.jansi</groupId>
+                        <artifactId>jansi</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
+                <groupId>org.antlr</groupId>
+                <artifactId>antlr-runtime</artifactId>
+                <version>${antlr3.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-collections4</artifactId>
+                <version>${commons.collections4}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.commons</groupId>
+                <artifactId>commons-lang3</artifactId>
+                <version>${common.lang3.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.hadoop</groupId>
+                <artifactId>hadoop-client</artifactId>
+                <version>${hadoop.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.spark</groupId>
+                <artifactId>spark-core_2.11</artifactId>
+                <version>${spark.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.spark</groupId>
+                <artifactId>spark-sql_2.11</artifactId>
+                <version>${spark.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codehaus.jackson</groupId>
+                <artifactId>jackson-core-asl</artifactId>
+                <version>1.9.13</version>
+            </dependency>
+            <dependency>
+                <groupId>org.codehaus.jackson</groupId>
+                <artifactId>jackson-mapper-asl</artifactId>
+                <version>1.9.13</version>
+            </dependency>
+            <dependency>
+                <groupId>org.glassfish.jaxb</groupId>
+                <artifactId>jaxb-runtime</artifactId>
+                <version>2.4.0-b180725.0644</version>
+                <exclusions>
+                    <exclusion>
+                        <groupId>jakarta.activation</groupId>
+                        <artifactId>jakarta.activation-api</artifactId>
+                    </exclusion>
+                </exclusions>
+            </dependency>
+            <dependency>
+                <groupId>org.javassist</groupId>
+                <artifactId>javassist</artifactId>
+                <version>3.24.0-GA</version>
+            </dependency>
+            <dependency>
+                <groupId>org.mockito</groupId>
+                <artifactId>mockito-all</artifactId>
+                <version>1.10.19</version>
+            </dependency>
+            <dependency>
+                <groupId>org.mockito</groupId>
+                <artifactId>mockito-core</artifactId>
+                <version>2.23.0</version>
+            </dependency>
+            <dependency>
+                <groupId>org.objenesis</groupId>
+                <artifactId>objenesis</artifactId>
+                <version>3.0.1</version>
+            </dependency>
+            <dependency>
+                <groupId>org.powermock</groupId>
+                <artifactId>powermock-core</artifactId>
+                <version>2.0.2</version>
+            </dependency>
+            <dependency>
+                <groupId>org.powermock</groupId>
+                <artifactId>powermock-api-mockito2</artifactId>
+                <version>2.0.2</version>
+            </dependency>
+            <dependency>
+                <groupId>org.powermock</groupId>
+                <artifactId>powermock-module-junit4</artifactId>
+                <version>2.0.2</version>
+            </dependency>
+            <dependency>
+                <groupId>org.scala-lang</groupId>
+                <artifactId>scala-library</artifactId>
+                <version>${scala.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.scala-lang</groupId>
+                <artifactId>scala-reflect</artifactId>
+                <version>${scala.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.scalatest</groupId>
+                <artifactId>scalatest_2.11</artifactId>
+                <version>3.0.5</version>
+            </dependency>
+            <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>jcl-over-slf4j</artifactId>
+                <version>1.7.25</version>
+            </dependency>
+            <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>jul-to-slf4j</artifactId>
+                <version>1.7.25</version>
+            </dependency>
+            <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>slf4j-api</artifactId>
+                <version>1.7.25</version>
+            </dependency>
+            <dependency>
+                <groupId>org.slf4j</groupId>
+                <artifactId>slf4j-log4j12</artifactId>
+                <version>1.7.25</version>
+            </dependency>
+            <dependency>
+                <groupId>org.xerial.snappy</groupId>
+                <artifactId>snappy-java</artifactId>
+                <version>1.0.5-M1</version>
+            </dependency>
+            <dependency>
                 <groupId>org.apache.thrift</groupId>
                 <artifactId>libthrift</artifactId>
                 <version>${thrift.version}</version>
@@ -107,31 +369,13 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>${junit.version}</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-all</artifactId>
-            <version>1.10.19</version>
             <scope>test</scope>
         </dependency>
-        <!-- for jdk-11 -->
-        <dependency>
-            <groupId>javax.annotation</groupId>
-            <artifactId>javax.annotation-api</artifactId>
-            <version>1.3.2</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.xml.bind</groupId>
-            <artifactId>jaxb-api</artifactId>
-            <version>2.4.0-b180725.0427</version>
-        </dependency>
-        <dependency>
-            <groupId>org.glassfish.jaxb</groupId>
-            <artifactId>jaxb-runtime</artifactId>
-            <version>2.4.0-b180725.0644</version>
-        </dependency>
     </dependencies>
     <modules>
         <module>tsfile</module>
@@ -202,6 +446,8 @@
                             <exclude>**/*.iml</exclude>
                             <!-- Runtime log -->
                             <exclude>**/*.log</exclude>
+                            <!-- Exclude CVS files -->
+                            <exclude>**/*.cvs</exclude>
                             <!-- licenses -->
                             <exclude>licenses/*</exclude>
                             <!-- generated by Github -->
@@ -210,14 +456,8 @@
                             <exclude>.checkstyle</exclude>
                             <!--Generated by Apache Release -->
                             <exclude>local-snapshots-dir/**</exclude>
-                            <!--IoTDB data files-->
-                            <exclude>iotdb/data/**</exclude>
-                            <exclude>iotdb/logs/**</exclude>
-                            <exclude>src/test/resources/*.json</exclude>
-                            <!-- for tsfile module -->
-                            <!-- if `mvn clean` is not executed and `mvn test` is interrupted, then perTestInputData may be not deleted -->
-                            <exclude>src/test/resources/perTestInputData</exclude>
-                            <exclude>src/test/resources/*.json</exclude>
+                            <!-- JSON can't contain comments and therefore no Apache header -->
+                            <exclude>*.json</exclude>
                             <exclude>NOTICE-binary</exclude>
                             <exclude>LICENSE-binary</exclude>
                         </excludes>
@@ -234,9 +474,44 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-enforcer-plugin</artifactId>
-                <version>3.0.0-M1</version>
+                <version>3.0.0-M2</version>
                 <!--$NO-MVN-MAN-VER$-->
                 <executions>
+                    <!-- Ensure we're not mixing dependency versions -->
+                    <execution>
+                        <id>enforce-version-convergence</id>
+                        <configuration>
+                            <rules>
+                                <dependencyConvergence/>
+                            </rules>
+                        </configuration>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                    </execution>
+                    <!--
+                        Fails the build if classes are included from multiple
+                        artifacts and these are not identical.
+                    -->
+                    <!--execution>
+                        <id>enforce-ban-duplicate-classes</id>
+                        <goals>
+                            <goal>enforce</goal>
+                        </goals>
+                        <configuration>
+                            <rules>
+                                <banDuplicateClasses>
+                                    <scopes>
+                                        <scope>compile</scope>
+                                        <scope>provided</scope>
+                                    </scopes>
+                                    <findAllDuplicates>true</findAllDuplicates>
+                                    <ignoreWhenIdentical>true</ignoreWhenIdentical>
+                                </banDuplicateClasses>
+                            </rules>
+                            <fail>true</fail>
+                        </configuration>
+                    </execution-->
                     <!-- Make sure no dependencies are used for which known vulnerabilities exist. -->
                     <execution>
                         <id>vulnerability-checks</id>
@@ -264,6 +539,11 @@
                         <artifactId>ossindex-maven-enforcer-rules</artifactId>
                         <version>1.0.0</version>
                     </dependency>
+                    <dependency>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>extra-enforcer-rules</artifactId>
+                        <version>1.2</version>
+                    </dependency>
                 </dependencies>
             </plugin>
             <!--
@@ -504,6 +784,58 @@
                 <thrift.exec-cmd.args>+x ${project.build.directory}/tools/${thrift.executable}</thrift.exec-cmd.args>
             </properties>
         </profile>
+        <!-- Some APIs were removed in Java 11, so we need to add replacements -->
+        <profile>
+            <id>java-11-and-above</id>
+            <activation>
+                <!-- This needs to be updated as soon as Java 20 is shipped -->
+                <jdk>[11,20)</jdk>
+            </activation>
+            <dependencies>
+                <!-- for jdk-11 -->
+                <dependency>
+                    <groupId>javax.annotation</groupId>
+                    <artifactId>javax.annotation-api</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>javax.xml.bind</groupId>
+                    <artifactId>jaxb-api</artifactId>
+                </dependency>
+                <dependency>
+                    <groupId>org.glassfish.jaxb</groupId>
+                    <artifactId>jaxb-runtime</artifactId>
+                </dependency>
+            </dependencies>
+            <!--build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-enforcer-plugin</artifactId>
+                        <version>3.0.0-M2</version>
+                        <executions>
+                            <execution>
+                                <id>enforce-ban-duplicate-classes</id>
+                                <goals>
+                                    <goal>enforce</goal>
+                                </goals>
+                                <configuration>
+                                    <rules combine.children="append">
+                                        <banDuplicateClasses>
+                                            <ignoreClasses>
+                                                <ignoreClass>javax.activation.*</ignoreClass>
+                                                <ignoreClass>javax.servlet.*</ignoreClass>
+                                                <ignoreClass>javax.ws.*</ignoreClass>
+                                            </ignoreClasses>
+                                        </banDuplicateClasses>
+                                    </rules>
+                                    <fail>true</fail>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build-->
+        </profile>
         <!--
           Self activating profile, that activates itself as soon as a "src/main/thrift" directory is found.
           The different plugins here download the thrift executable matching the current os, make that
diff --git a/server/pom.xml b/server/pom.xml
index 43a7d3f..9055d28 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -30,8 +30,6 @@
     <artifactId>iotdb-server</artifactId>
     <name>IoTDB Server</name>
     <properties>
-        <antlr3.version>3.5.2</antlr3.version>
-        <common.lang3.version>3.8.1</common.lang3.version>
         <iotdb.test.skip>false</iotdb.test.skip>
         <iotdb.it.skip>${iotdb.test.skip}</iotdb.it.skip>
         <iotdb.ut.skip>${iotdb.test.skip}</iotdb.ut.skip>
@@ -40,35 +38,32 @@
         <dependency>
             <groupId>org.apache.iotdb</groupId>
             <artifactId>service-rpc</artifactId>
-            <version>${project.version}</version>
+            <version>0.9.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.iotdb</groupId>
             <artifactId>tsfile</artifactId>
-            <version>${project.version}</version>
+            <version>0.9.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.iotdb</groupId>
             <artifactId>iotdb-jdbc</artifactId>
-            <version>${project.version}</version>
+            <version>0.9.0-SNAPSHOT</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-collections4</artifactId>
-            <version>${commons.collections4}</version>
         </dependency>
         <!-- https://mvnrepository.com/artifact/org.antlr/antlr-runtime -->
         <dependency>
             <groupId>org.antlr</groupId>
             <artifactId>antlr-runtime</artifactId>
-            <version>${antlr3.version}</version>
         </dependency>
         <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
-            <version>${common.lang3.version}</version>
         </dependency>
         <dependency>
             <groupId>io.airlift</groupId>
@@ -78,53 +73,22 @@
         <dependency>
             <groupId>org.powermock</groupId>
             <artifactId>powermock-core</artifactId>
-            <version>2.0.2</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.powermock</groupId>
             <artifactId>powermock-module-junit4</artifactId>
-            <version>2.0.2</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.powermock</groupId>
             <artifactId>powermock-api-mockito2</artifactId>
-            <version>2.0.2</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
     <build>
         <plugins>
             <plugin>
-                <artifactId>maven-clean-plugin</artifactId>
-                <configuration>
-                    <filesets>
-                        <fileset>
-                            <directory>${project.basedir}/iotdb/lib</directory>
-                            <includes>
-                                <include>**/*.jar</include>
-                            </includes>
-                            <followSymlinks>false</followSymlinks>
-                        </fileset>
-                        <fileset>
-                            <directory>${project.basedir}/data</directory>
-                            <includes>
-                                <include>**/*</include>
-                            </includes>
-                            <followSymlinks>false</followSymlinks>
-                        </fileset>
-                        <fileset>
-                            <directory>${project.basedir}/logs</directory>
-                            <includes>
-                                <include>**/*</include>
-                            </includes>
-                            <followSymlinks>false</followSymlinks>
-                        </fileset>
-                    </filesets>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.antlr</groupId>
                 <artifactId>antlr3-maven-plugin</artifactId>
                 <version>${antlr3.version}</version>
@@ -136,29 +100,6 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>copy-dependencies</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>copy-dependencies</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${project.basedir}/iotdb/lib</outputDirectory>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <configuration>
-                    <outputDirectory>${project.basedir}/iotdb/lib</outputDirectory>
-                </configuration>
-            </plugin>
             <!--using `mvn test` to run UT, `mvn verify` to run ITs
                         Reference: https://antoniogoncalves.org/2012/12/13/lets-turn-integration-tests-with-maven-to-a-first-class-citizen/-->
             <plugin>
@@ -186,6 +127,26 @@
                     <skipITs>${iotdb.it.skip}</skipITs>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <!-- Package binaries-->
+                    <execution>
+                        <id>server-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <descriptors>
+                                <descriptor>src/assembly/server.xml</descriptor>
+                            </descriptors>
+                            <appendAssemblyId>false</appendAssemblyId>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
     <profiles>
diff --git a/server/iotdb/conf/iotdb-engine.properties b/server/src/assembly/resources/conf/iotdb-engine.properties
similarity index 100%
rename from server/iotdb/conf/iotdb-engine.properties
rename to server/src/assembly/resources/conf/iotdb-engine.properties
diff --git a/server/iotdb/conf/iotdb-env.bat b/server/src/assembly/resources/conf/iotdb-env.bat
similarity index 100%
rename from server/iotdb/conf/iotdb-env.bat
rename to server/src/assembly/resources/conf/iotdb-env.bat
diff --git a/server/iotdb/conf/iotdb-env.sh b/server/src/assembly/resources/conf/iotdb-env.sh
similarity index 100%
rename from server/iotdb/conf/iotdb-env.sh
rename to server/src/assembly/resources/conf/iotdb-env.sh
diff --git a/server/iotdb/conf/iotdb-sync-client.properties b/server/src/assembly/resources/conf/iotdb-sync-client.properties
similarity index 100%
rename from server/iotdb/conf/iotdb-sync-client.properties
rename to server/src/assembly/resources/conf/iotdb-sync-client.properties
diff --git a/server/iotdb/conf/logback-tool.xml b/server/src/assembly/resources/conf/logback-tool.xml
similarity index 100%
copy from server/iotdb/conf/logback-tool.xml
copy to server/src/assembly/resources/conf/logback-tool.xml
diff --git a/server/iotdb/conf/logback.xml b/server/src/assembly/resources/conf/logback.xml
similarity index 100%
rename from server/iotdb/conf/logback.xml
rename to server/src/assembly/resources/conf/logback.xml
diff --git a/server/iotdb/conf/tsfile-format.properties b/server/src/assembly/resources/conf/tsfile-format.properties
similarity index 100%
rename from server/iotdb/conf/tsfile-format.properties
rename to server/src/assembly/resources/conf/tsfile-format.properties
diff --git a/server/iotdb/sbin/start-server.bat b/server/src/assembly/resources/sbin/start-server.bat
similarity index 100%
rename from server/iotdb/sbin/start-server.bat
rename to server/src/assembly/resources/sbin/start-server.bat
diff --git a/server/iotdb/sbin/start-server.sh b/server/src/assembly/resources/sbin/start-server.sh
similarity index 100%
rename from server/iotdb/sbin/start-server.sh
rename to server/src/assembly/resources/sbin/start-server.sh
diff --git a/server/iotdb/sbin/stop-server.bat b/server/src/assembly/resources/sbin/stop-server.bat
similarity index 100%
rename from server/iotdb/sbin/stop-server.bat
rename to server/src/assembly/resources/sbin/stop-server.bat
diff --git a/server/iotdb/sbin/stop-server.sh b/server/src/assembly/resources/sbin/stop-server.sh
similarity index 100%
rename from server/iotdb/sbin/stop-server.sh
rename to server/src/assembly/resources/sbin/stop-server.sh
diff --git a/server/iotdb/tools/memory-tool.bat b/server/src/assembly/resources/tools/memory-tool.bat
similarity index 100%
rename from server/iotdb/tools/memory-tool.bat
rename to server/src/assembly/resources/tools/memory-tool.bat
diff --git a/server/iotdb/tools/memory-tool.sh b/server/src/assembly/resources/tools/memory-tool.sh
similarity index 100%
rename from server/iotdb/tools/memory-tool.sh
rename to server/src/assembly/resources/tools/memory-tool.sh
diff --git a/server/iotdb/tools/start-WalChecker.bat b/server/src/assembly/resources/tools/start-WalChecker.bat
similarity index 100%
rename from server/iotdb/tools/start-WalChecker.bat
rename to server/src/assembly/resources/tools/start-WalChecker.bat
diff --git a/server/iotdb/tools/start-WalChecker.sh b/server/src/assembly/resources/tools/start-WalChecker.sh
similarity index 100%
rename from server/iotdb/tools/start-WalChecker.sh
rename to server/src/assembly/resources/tools/start-WalChecker.sh
diff --git a/server/iotdb/tools/start-sync-client.bat b/server/src/assembly/resources/tools/start-sync-client.bat
similarity index 100%
rename from server/iotdb/tools/start-sync-client.bat
rename to server/src/assembly/resources/tools/start-sync-client.bat
diff --git a/server/iotdb/tools/start-sync-client.sh b/server/src/assembly/resources/tools/start-sync-client.sh
similarity index 100%
rename from server/iotdb/tools/start-sync-client.sh
rename to server/src/assembly/resources/tools/start-sync-client.sh
diff --git a/server/iotdb/tools/stop-sync-client.bat b/server/src/assembly/resources/tools/stop-sync-client.bat
similarity index 100%
rename from server/iotdb/tools/stop-sync-client.bat
rename to server/src/assembly/resources/tools/stop-sync-client.bat
diff --git a/server/iotdb/tools/stop-sync-client.sh b/server/src/assembly/resources/tools/stop-sync-client.sh
similarity index 100%
rename from server/iotdb/tools/stop-sync-client.sh
rename to server/src/assembly/resources/tools/stop-sync-client.sh
diff --git a/server/iotdb/conf/logback-tool.xml b/server/src/assembly/server.xml
similarity index 63%
rename from server/iotdb/conf/logback-tool.xml
rename to server/src/assembly/server.xml
index 98f3f9d..9b2df21 100644
--- a/server/iotdb/conf/logback-tool.xml
+++ b/server/src/assembly/server.xml
@@ -19,4 +19,22 @@
     under the License.
 
 -->
-<configuration/>
+<assembly>
+    <id>server</id>
+    <formats>
+        <format>dir</format>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>lib</outputDirectory>
+        </dependencySet>
+    </dependencySets>
+    <fileSets>
+        <fileSet>
+            <directory>src/assembly/resources</directory>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>
diff --git a/server/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java b/server/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java
index 2f7e833..f08e167 100644
--- a/server/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java
+++ b/server/src/test/java/org/apache/iotdb/db/script/EnvScriptIT.java
@@ -20,10 +20,7 @@ package org.apache.iotdb.db.script;
 
 import static org.junit.Assert.assertEquals;
 
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
+import java.io.*;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.After;
@@ -51,19 +48,19 @@ public class EnvScriptIT {
   }
 
   private void testStartClientOnWindows(String suffix, String os) throws IOException {
-    String dir = getCurrentPath("cmd.exe", "/c", "echo %cd%");
+    String dir = getServerPath();
     final String output = "If you want to change this configuration, please check conf/iotdb-env.sh(Unix or OS X, if you use Windows, check conf/iotdb-env.bat).";
     String cmd =
-        dir + File.separator + "iotdb" + File.separator + "conf" + File.separator + "iotdb-env"
+        dir + File.separator + "conf" + File.separator + "iotdb-env"
             + suffix;
     ProcessBuilder startBuilder = new ProcessBuilder("cmd.exe", "/c", cmd);
     testOutput(dir, suffix, startBuilder, output, os);
   }
 
   private void testStartClientOnUnix(String suffix, String os) throws IOException {
-    String dir = getCurrentPath("pwd");
+    String dir = getServerPath();
     final String output = "If you want to change this configuration, please check conf/iotdb-env.sh(Unix or OS X, if you use Windows, check conf/iotdb-env.bat).";
-    String cmd = dir + File.separator + "iotdb" + File.separator + "conf" + File.separator + "iotdb-env"
+    String cmd = dir + File.separator + "conf" + File.separator + "iotdb-env"
             + suffix;
     ProcessBuilder builder = new ProcessBuilder("bash", cmd);
     testOutput(cmd, suffix, builder, output, os);
@@ -101,4 +98,25 @@ public class EnvScriptIT {
     String path = r.readLine();
     return path;
   }
+
+  protected String getServerPath() {
+    // This is usually always set by the JVM
+    File userDir = new File(System.getProperty("user.dir"));
+    if(!userDir.exists()) {
+      throw new RuntimeException("user.dir " + userDir.getAbsolutePath() + " doesn't exist.");
+    }
+    File targetDir = new File(userDir, "target");
+    File[] files = targetDir.listFiles(new FileFilter() {
+      @Override
+      public boolean accept(File pathname) {
+        return pathname.isDirectory() && pathname.getName().startsWith("iotdb-server-");
+      }
+    });
+    if(files.length != 1) {
+      throw new RuntimeException(
+              "Exactly one directory starting with 'iotdb-server-' should have been found, but was " + files.length);
+    }
+    return files[0].getAbsolutePath();
+  }
+
 }
diff --git a/spark-tsfile/pom.xml b/spark-tsfile/pom.xml
index 3d74f8f..4613de1 100644
--- a/spark-tsfile/pom.xml
+++ b/spark-tsfile/pom.xml
@@ -29,38 +29,34 @@
     </parent>
     <artifactId>spark-tsfile</artifactId>
     <packaging>jar</packaging>
+    <name>IoTDB Spark-TsFile</name>
     <dependencies>
         <dependency>
             <groupId>org.apache.iotdb</groupId>
             <artifactId>tsfile</artifactId>
-            <version>${project.version}</version>
+            <version>0.9.0-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.hadoop</groupId>
             <artifactId>hadoop-client</artifactId>
-            <version>${hadoop.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.spark</groupId>
             <artifactId>spark-core_2.11</artifactId>
-            <version>${spark.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.spark</groupId>
             <artifactId>spark-sql_2.11</artifactId>
-            <version>${spark.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.scala-lang</groupId>
             <artifactId>scala-library</artifactId>
-            <version>${scala.version}</version>
         </dependency>
         <dependency>
             <groupId>org.scalatest</groupId>
             <artifactId>scalatest_2.11</artifactId>
-            <version>3.0.5</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
@@ -91,4 +87,28 @@
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>java-11-and-above</id>
+            <activation>
+                <!-- This needs to be updated as soon as Java 20 is shipped -->
+                <jdk>[11,20)</jdk>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>net.alchim31.maven</groupId>
+                        <artifactId>scala-maven-plugin</artifactId>
+                        <version>3.2.0</version>
+                        <!-- Added to avoid problems with Java 11 and above -->
+                        <configuration>
+                            <args>
+                                <arg>-nobootcp</arg>
+                            </args>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 </project>
diff --git a/spark-tsfile/src/test/scala/org/apache/iotdb/tsfile/HDFSInputTest.java b/spark-tsfile/src/test/scala/org/apache/iotdb/tsfile/HDFSInputTest.java
index 43a88a4..5f6da88 100644
--- a/spark-tsfile/src/test/scala/org/apache/iotdb/tsfile/HDFSInputTest.java
+++ b/spark-tsfile/src/test/scala/org/apache/iotdb/tsfile/HDFSInputTest.java
@@ -30,7 +30,7 @@ import org.junit.Test;
 
 public class HDFSInputTest {
 
-  private String folder = "../spark/src/test/resources/HDFSInputTest";
+  private String folder = "target/test-output/HDFSInputTest";
   private String path = folder + "/test.tsfile";
   private HDFSInput in;
 
diff --git a/tsfile/pom.xml b/tsfile/pom.xml
index 709a4ef..cab5fb5 100644
--- a/tsfile/pom.xml
+++ b/tsfile/pom.xml
@@ -44,17 +44,14 @@
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>fastjson</artifactId>
-            <version>1.2.31</version>
         </dependency>
         <dependency>
             <groupId>org.xerial.snappy</groupId>
             <artifactId>snappy-java</artifactId>
-            <version>1.0.5-M1</version>
         </dependency>
         <dependency>
             <groupId>commons-io</groupId>
             <artifactId>commons-io</artifactId>
-            <version>${common.io.version}</version>
         </dependency>
     </dependencies>
     <build>