You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2021/01/31 02:39:56 UTC
[iotdb] branch master updated: refactor CI by split a CI into
several parts, fix code-coverage and extract jar-with-dependencies (#2603)
This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 946d4b8 refactor CI by split a CI into several parts, fix code-coverage and extract jar-with-dependencies (#2603)
946d4b8 is described below
commit 946d4b874dd911466150054087b79afda66b9f8c
Author: Xiangdong Huang <hx...@apache.org>
AuthorDate: Sun Jan 31 10:39:32 2021 +0800
refactor CI by split a CI into several parts, fix code-coverage and extract jar-with-dependencies (#2603)
* split `jar-with-dependencies` into an individual Profile.
* add code-coverage module
* support jdk15
---
.github/workflows/client.yml | 8 +-
.github/workflows/main-linux.yml | 70 +++++++++++++
.github/workflows/main-mac.yml | 46 +++++++++
.github/workflows/{main-ci.yml => main-win.yml} | 61 +++++------
.github/workflows/sonar_and_coverall.yml | 76 --------------
Jenkinsfile | 4 +-
cluster/pom.xml | 14 +++
code-coverage/README.md | 24 +++++
code-coverage/copy-code-coverage-sources.sh | 30 ++++++
code-coverage/pom.xml | 132 ++++++++++++++++++++++++
example/udf/pom.xml | 48 +++++----
hadoop/pom.xml | 47 +++++----
hive-connector/pom.xml | 53 +++++-----
jdbc/pom.xml | 47 +++++----
pom.xml | 100 +++++++++++++-----
server/pom.xml | 14 +++
service-rpc/pom.xml | 20 ----
session/pom.xml | 47 +++++----
thrift/pom.xml | 20 ----
tsfile/pom.xml | 47 +++++----
zeppelin-interpreter/pom.xml | 49 +++++----
21 files changed, 632 insertions(+), 325 deletions(-)
diff --git a/.github/workflows/client.yml b/.github/workflows/client.yml
index 033eb5b..4ec4269 100644
--- a/.github/workflows/client.yml
+++ b/.github/workflows/client.yml
@@ -31,7 +31,6 @@ jobs:
fail-fast: false
max-parallel: 20
matrix:
- java: [11.0.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os}}
@@ -40,7 +39,7 @@ jobs:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
- java-version: ${{ matrix.java }}
+ java-version: 11
- name: Install CPP Dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
shell: bash
@@ -60,14 +59,13 @@ jobs:
key: client-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Test with Maven
- run: mvn -B clean integration-test -Pclient-cpp -Dtsfile.test.skip=true -Djdbc.test.skip=true -Diotdb.test.skip=true -Dtest.port.closed=true -Denforcer.skip=true -pl server,client-cpp,example/client-cpp-example -am
+ run: mvn -B clean integration-test -Pclient-cpp -Dtsfile.test.skip=true -Djdbc.test.skip=true -Diotdb.test.skip=true -Dtest.port.closed=true -pl server,client-cpp,example/client-cpp-example -am
build-win:
strategy:
fail-fast: false
max-parallel: 20
matrix:
- java: [11.0.x]
os: [windows-latest]
runs-on: ${{ matrix.os}}
@@ -76,7 +74,7 @@ jobs:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
- java-version: ${{ matrix.java }}
+ java-version: 11
- name: Cache Maven packages
uses: actions/cache@v2
with:
diff --git a/.github/workflows/main-linux.yml b/.github/workflows/main-linux.yml
new file mode 100644
index 0000000..e26dbe7
--- /dev/null
+++ b/.github/workflows/main-linux.yml
@@ -0,0 +1,70 @@
+# This workflow will build a Java project with Maven
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: Main Linux
+# Main Unix is quite different with Mac and Win Github Action.
+# It consists of not only the UT/IT, but also code coverage and sonar report.
+
+on:
+ push:
+ branches:
+ - master
+ - 'rel/*'
+ paths-ignore:
+ - 'docs/**'
+ pull_request:
+ branches:
+ - master
+ - 'rel/*'
+ - cluster_new
+ paths-ignore:
+ - 'docs/**'
+
+jobs:
+ ubuntu:
+ strategy:
+ fail-fast: false
+ max-parallel: 20
+ matrix:
+ java: [8, 11, 15]
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+ - name: Cache Maven packages
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2
+ key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2-
+ - name: Check Apache Rat
+ run: mvn -B apache-rat:check -P client-cpp -P site -P code-coverage
+ - name: IT/UT Test
+ run: mvn -B clean post-integration-test -Dtest.port.closed=true -Pcode-coverage
+ - name: Code Coverage (Coveralls)
+ if: ${{ success() && matrix.java == '8'}}
+ run: |
+ mvn -B post-integration-test -Pcode-coverage -pl code-coverage
+ mvn -B coveralls:report \
+ -DserviceName=travis_ci \
+ -Dbranch=$BRANCH_NAME \
+ -DpullRequest=$PR_NUMBER \
+ -DrepoToken=MiEOlMMMNQhLNV4yayn7rRUPyVSQzbzbZ \
+ -Pcode-coverage
+ - name: SonarCloud Report
+ #jdk8 is faster to run UT/IT
+ if: ${{ success() && matrix.java == '8'}}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ SONAR_TOKEN: '2d9c9a58d772a57806a168e00181e3e19f2763dc'
+ run: |
+ mvn -B verify sonar:sonar \
+ -Dsonar.organization=apache \
+ -Dsonar.projectKey=apache_incubator-iotdb \
+ -Dsonar.host.url=https://sonarcloud.io \
+ -Dsonar.login=${{ secrets.SONARCLOUD_TOKEN }} \
+ -DskipTests -pl '!distribution' -am
diff --git a/.github/workflows/main-mac.yml b/.github/workflows/main-mac.yml
new file mode 100644
index 0000000..a23d58a
--- /dev/null
+++ b/.github/workflows/main-mac.yml
@@ -0,0 +1,46 @@
+# This workflow will build a Java project with Maven
+# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
+
+name: Main Mac
+
+on:
+ push:
+ branches:
+ - master
+ - 'rel/*'
+ paths-ignore:
+ - 'docs/**'
+ pull_request:
+ branches:
+ - master
+ - 'rel/*'
+ - cluster_new
+ paths-ignore:
+ - 'docs/**'
+
+jobs:
+ unix:
+ strategy:
+ fail-fast: false
+ max-parallel: 20
+ matrix:
+ java: [8, 11]
+ runs-on: macos-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up JDK ${{ matrix.java }}
+ uses: actions/setup-java@v1
+ with:
+ java-version: ${{ matrix.java }}
+ - name: Cache Maven packages
+ uses: actions/cache@v2
+ with:
+ path: ~/.m2
+ key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+ restore-keys: ${{ runner.os }}-m2-
+ - name: Check Apache Rat
+ run: mvn -B apache-rat:check -P client-cpp -P site -P code-coverage
+ - name: IT/UT Test
+ shell: bash
+ run: mvn -B clean post-integration-test -Dtest.port.closed=true
diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-win.yml
similarity index 78%
rename from .github/workflows/main-ci.yml
rename to .github/workflows/main-win.yml
index 3c7250d..9a12f1c 100644
--- a/.github/workflows/main-ci.yml
+++ b/.github/workflows/main-win.yml
@@ -1,7 +1,7 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-name: Java CI with Maven
+name: Main Win
on:
push:
@@ -19,40 +19,25 @@ on:
- 'docs/**'
jobs:
- build:
+ win:
strategy:
fail-fast: false
max-parallel: 20
matrix:
- java: [8, 11.0.x]
- os: [ubuntu-latest, macos-latest]
- runs-on: ${{ matrix.os}}
-
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK ${{ matrix.java }}
- uses: actions/setup-java@v1
- with:
- java-version: ${{ matrix.java }}
- - name: Cache Maven packages
- uses: actions/cache@v2
- with:
- path: ~/.m2
- key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2-
- - name: Check Apache Rat
- run: mvn -B apache-rat:check -P client-cpp
- - name: Test with Maven
- run: mvn -B clean integration-test -Dtest.port.closed=true -Denforcer.skip=true
-
- build-win:
- strategy:
- fail-fast: false
- max-parallel: 20
- matrix:
- java: [8, 11.0.x]
- os: [windows-latest]
- runs-on: ${{ matrix.os}}
+ java: [8, 11]
+ # to reduce the CI time cost; we split the whole CI to 3 parts:
+ # modules except the server and the cluster:
+ # -Diotdb.skip.test=true -Dcluster.skip.test=true
+ # the server module:
+ # -pl server -am -DskipTests=true -Diotdb.test.only=true
+ # the cluster module:
+ # -pl cluster -am -DskipTests=true -Dcluster.test.only=true
+ # but we just add labels here to make the action name more graceful
+ it_task: ['others',
+ 'server',
+ 'cluster'
+ ]
+ runs-on: windows-latest
steps:
- uses: actions/checkout@v2
@@ -107,6 +92,16 @@ jobs:
path: D:\a\hadoop
key: ${{ runner.os }}-hadoop-files${{ hashFiles('**/*.exe') }}
restore-keys: ${{ runner.os }}-hadoop-files
- - name: Test with Maven
+ - name: Test Server Module with Maven
+ shell: bash
+ if: ${{ matrix.it_task == 'server'}}
+ run: source ~/.bash_profile && mvn -B clean integration-test -Dtest.port.closed=true -pl server -am -DskipTests=true -Diotdb.test.only=true
+ - name: Test Cluster Module with Maven
shell: bash
- run: source ~/.bash_profile && mvn -B clean integration-test -Dtest.port.closed=true -Denforcer.skip=true
\ No newline at end of file
+ if: ${{ matrix.it_task == 'cluster'}}
+ run: source ~/.bash_profile && mvn -B clean integration-test -Dtest.port.closed=true -pl cluster -am -DskipTests=true -Dcluster.test.only=true
+ - name: Test Other Modules with Maven
+ shell: bash
+ if: ${{ matrix.it_task == 'others'}}
+ run: source ~/.bash_profile && mvn -B clean integration-test -Dtest.port.closed=true -Diotdb.test.skip=true -Dcluster.test.skip=true
+
diff --git a/.github/workflows/sonar_and_coverall.yml b/.github/workflows/sonar_and_coverall.yml
deleted file mode 100644
index f8d201d..0000000
--- a/.github/workflows/sonar_and_coverall.yml
+++ /dev/null
@@ -1,76 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: Sonar And Coverall with Maven
-
-on:
- push:
- branches:
- - master
- - 'rel/*'
- paths-ignore:
- - 'docs/**'
- pull_request:
- branches:
- - master
- - 'rel/*'
- - cluster_new
- paths-ignore:
- - 'docs/**'
-
-jobs:
- sonar:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 11.0.x
- uses: actions/setup-java@v1
- with:
- java-version: 11.0.x
- - name: Cache Maven packages
- uses: actions/cache@v2
- with:
- path: ~/.m2
- key: sonar-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2
- - name: SonarCloud Test
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- SONAR_TOKEN: '2d9c9a58d772a57806a168e00181e3e19f2763dc'
- run: |
- mvn -B verify sonar:sonar \
- -Dsonar.organization=apache \
- -Dsonar.projectKey=apache_incubator-iotdb \
- -Dsonar.host.url=https://sonarcloud.io \
- -Dsonar.login=${{ secrets.SONARCLOUD_TOKEN }} \
- -DskipTests -pl '!distribution' -am
-
- coveralls:
- runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 1.8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
- - name: Cache Maven packages
- uses: actions/cache@v2
- with:
- path: ~/.m2
- key: code-coverage-${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2
- - name: Run Integration Test
- run: mvn -B post-integration-test -Pcode-coverage -Pcoveralls -pl '!distribution' -am
- - name: Code Coverage (Coveralls) Test
- run: |
- mvn -B coveralls:report \
- --no-transfer-progress \
- -DserviceName=travis_ci \
- -D branch=$BRANCH_NAME \
- -D pullRequest=$PR_NUMBER \
- -D repoToken=MiEOlMMMNQhLNV4yayn7rRUPyVSQzbzbZ \
- -pl tsfile,server,jdbc,cli,session,hive-connector,flink-iotdb-connector,flink-tsfile-connector
diff --git a/Jenkinsfile b/Jenkinsfile
index f3b6886..c883763 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -85,7 +85,7 @@ pipeline {
sh 'mvn clean'
// We'll deploy to a relative directory so we can
// deploy new versions only if the entire build succeeds
- sh 'mvn ${MVN_TEST_FAIL_IGNORE} -DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir -P client-cpp clean deploy'
+ sh 'mvn ${MVN_TEST_FAIL_IGNORE} -DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir -P client-cpp clean deploy -P get-jar-with-dependencies'
}
post {
always {
@@ -120,7 +120,7 @@ pipeline {
steps {
echo 'Deploying'
// Deploy the artifacts using the wagon-maven-plugin.
- sh 'mvn -f jenkins.pom -X -P deploy-snapshots -P client-cpp wagon:upload'
+ sh 'mvn -f jenkins.pom -X -P deploy-snapshots -P client-cpp wagon:upload -P get-jar-with-dependencies'
}
}
diff --git a/cluster/pom.xml b/cluster/pom.xml
index 6d257d1..1d29693 100644
--- a/cluster/pom.xml
+++ b/cluster/pom.xml
@@ -151,6 +151,20 @@
<cluster.ut.skip>true</cluster.ut.skip>
</properties>
</profile>
+ <profile>
+ <id>only_test_Cluster</id>
+ <activation>
+ <property>
+ <name>cluster.test.only</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <properties>
+ <cluster.test.skip>false</cluster.test.skip>
+ <cluster.ut.skip>false</cluster.ut.skip>
+ <cluster.it.skip>false</cluster.it.skip>
+ </properties>
+ </profile>
</profiles>
<build>
<plugins>
diff --git a/code-coverage/README.md b/code-coverage/README.md
new file mode 100644
index 0000000..a5c0124
--- /dev/null
+++ b/code-coverage/README.md
@@ -0,0 +1,24 @@
+<!--
+
+ 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.
+
+-->
+
+This module is just for generating correct code-coverage repoort.
+
+It can only be run on Unix.
diff --git a/code-coverage/copy-code-coverage-sources.sh b/code-coverage/copy-code-coverage-sources.sh
new file mode 100755
index 0000000..07ccc9c
--- /dev/null
+++ b/code-coverage/copy-code-coverage-sources.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env 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.
+#
+
+for file in ../*/target/*.exec
+do
+ cp $file ./target/
+done
+
+for file in ../*/target/classes
+do
+ echo "copy from" ${file}
+ cp -r $file ./target/
+done
diff --git a/code-coverage/pom.xml b/code-coverage/pom.xml
new file mode 100644
index 0000000..e68290b
--- /dev/null
+++ b/code-coverage/pom.xml
@@ -0,0 +1,132 @@
+<?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>
+ <parent>
+ <groupId>org.apache.iotdb</groupId>
+ <artifactId>iotdb-parent</artifactId>
+ <version>0.12.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <artifactId>iotdb-code-coverage</artifactId>
+ <packaging>pom</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>exec-maven-plugin</artifactId>
+ <groupId>org.codehaus.mojo</groupId>
+ <executions>
+ <execution>
+ <id>make-cmake-executable</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <basedir>${project.basedir}</basedir>
+ <executable>chmod</executable>
+ <arguments>
+ <argument>+x</argument>
+ <argument>copy-code-coverage-sources.sh</argument>
+ </arguments>
+ </configuration>
+ </execution>
+ <execution>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <executable>${project.basedir}/copy-code-coverage-sources.sh</executable>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.8.5</version>
+ <configuration>
+ <rules>
+ <rule implementation="org.jacoco.maven.RuleConfiguration">
+ <element>BUNDLE</element>
+ <limits>
+ <!-- Cover methodes >=30%. (the plugin does not support
+ ignore getter and setter and toString etc..) -->
+ <limit implementation="org.jacoco.report.check.Limit">
+ <counter>METHOD</counter>
+ <value>COVEREDRATIO</value>
+ <minimum>0.00</minimum>
+ </limit>
+ <!-- if-else, swtich etc.. >=70% -->
+ <limit implementation="org.jacoco.report.check.Limit">
+ <counter>BRANCH</counter>
+ <value>COVEREDRATIO</value>
+ <minimum>0.00</minimum>
+ </limit>
+ <!-- class files >=95% -->
+ <limit implementation="org.jacoco.report.check.Limit">
+ <counter>CLASS</counter>
+ <value>COVEREDRATIO</value>
+ <minimum>0.00</minimum>
+ </limit>
+ </limits>
+ </rule>
+ </rules>
+ </configuration>
+ <executions>
+ <!-- see https://natritmeyer.com/howto/reporting-aggregated-unit-and-integration-test-coverage-with-jacoco/-->
+ <execution>
+ <id>merge-unit-and-integration-final</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>merge</goal>
+ </goals>
+ <configuration>
+ <fileSets>
+ <fileSet>
+ <directory>${project.build.directory}/</directory>
+ <includes>
+ <include>*.exec</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ <destFile>${project.build.directory}/merged.exec</destFile>
+ </configuration>
+ </execution>
+ <execution>
+ <id>create-merged-report-final</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>report</goal>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <dataFile>${project.build.directory}/merged.exec</dataFile>
+ <outputDirectory>${project.build.directory}/jacoco-merged-reports</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/example/udf/pom.xml b/example/udf/pom.xml
index 5fc640e..7bb1468 100644
--- a/example/udf/pom.xml
+++ b/example/udf/pom.xml
@@ -35,24 +35,6 @@
<build>
<plugins>
<plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>3.1.0</version>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
@@ -64,6 +46,7 @@
<plugin>
<groupId>org.apache.rat</groupId>
<artifactId>apache-rat-plugin</artifactId>
+ <version>0.13</version>
<configuration>
<consoleOutput>false</consoleOutput>
</configuration>
@@ -79,4 +62,33 @@
</plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>get-jar-with-dependencies</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>3.1.0</version>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <!-- this is used for inheritance merges -->
+ <phase>package</phase>
+ <!-- bind to the packaging phase -->
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/hadoop/pom.xml b/hadoop/pom.xml
index 6fd887a..776e377 100644
--- a/hadoop/pom.xml
+++ b/hadoop/pom.xml
@@ -125,26 +125,6 @@
<skipITs>${hadoop.it.skip}</skipITs>
</configuration>
</plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${maven.assembly.version}</version>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <!-- this is used for inheritance merges -->
- <phase>package</phase>
- <!-- bind to the packaging phase -->
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
<profiles>
@@ -174,5 +154,32 @@
<hadoop.ut.skip>true</hadoop.ut.skip>
</properties>
</profile>
+ <profile>
+ <id>get-jar-with-dependencies</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>${maven.assembly.version}</version>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <!-- this is used for inheritance merges -->
+ <phase>package</phase>
+ <!-- bind to the packaging phase -->
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
diff --git a/hive-connector/pom.xml b/hive-connector/pom.xml
index c02b268..7a0355d 100644
--- a/hive-connector/pom.xml
+++ b/hive-connector/pom.xml
@@ -168,30 +168,6 @@
</dependency>
</dependencies>
</dependencyManagement>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${maven.assembly.version}</version>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <!-- this is used for inheritance merges -->
- <phase>package</phase>
- <!-- bind to the packaging phase -->
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
<!-- org.pentaho:pentaho-aggdesigner-algorithm is in repo.spring.io and we have to claim
to use https-->
<!-- Please note the notice in https://spring.io/blog/2020/10/29/notice-of-permissions-changes-to-repo-spring-io-fall-and-winter-2020
@@ -212,4 +188,33 @@
</snapshots>
</repository>
</repositories>
+ <profiles>
+ <profile>
+ <id>get-jar-with-dependencies</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>${maven.assembly.version}</version>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <!-- this is used for inheritance merges -->
+ <phase>package</phase>
+ <!-- bind to the packaging phase -->
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git a/jdbc/pom.xml b/jdbc/pom.xml
index aeec890..41e1ffd 100644
--- a/jdbc/pom.xml
+++ b/jdbc/pom.xml
@@ -146,26 +146,6 @@
</archive>
</configuration>
</plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${maven.assembly.version}</version>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <!-- this is used for inheritance merges -->
- <phase>package</phase>
- <!-- bind to the packaging phase -->
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </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>
@@ -260,5 +240,32 @@
<jdbc.ut.skip>true</jdbc.ut.skip>
</properties>
</profile>
+ <profile>
+ <id>get-jar-with-dependencies</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>${maven.assembly.version}</version>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <!-- this is used for inheritance merges -->
+ <phase>package</phase>
+ <!-- bind to the packaging phase -->
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
diff --git a/pom.xml b/pom.xml
index edfe2a8..c901853 100644
--- a/pom.xml
+++ b/pom.xml
@@ -135,17 +135,22 @@
<jetty.version>9.4.24.v20191120</jetty.version>
<metrics.version>3.2.6</metrics.version>
<javax.xml.bind.version>2.4.0-b180725.0427</javax.xml.bind.version>
- <felix.version>4.2.1</felix.version>
+ <felix.version>5.1.1</felix.version>
<!-- URL of the ASF SonarQube server -->
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>apache</sonar.organization>
<!-- Exclude all generated code -->
<sonar.exclusions>**/generated-sources</sonar.exclusions>
+ <sonar.java.checkstyle.reportPaths>checkstyle.xml</sonar.java.checkstyle.reportPaths>
+ <sonar.coverage.jacoco.xmlReportPaths>target/jacoco-merged-reports/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
+ <sonar.junit.reportPaths>target/surefire-reports,target/failsafe-reports</sonar.junit.reportPaths>
<!-- By default, the argLine is empty-->
<gson.version>2.8.6</gson.version>
<argLine/>
<!-- whether enable compiling the cpp client-->
<client-cpp>false</client-cpp>
+ <!-- disable enforcer by default-->
+ <enforcer.skip>true</enforcer.skip>
</properties>
<!--
if we claim dependencies in dependencyManagement, then we do not claim
@@ -593,14 +598,45 @@
</excludes>
</configuration>
</plugin>
- <plugin>
- <groupId>org.eluder.coveralls</groupId>
- <artifactId>coveralls-maven-plugin</artifactId>
- <version>4.3.0</version>
- </plugin>
</plugins>
</pluginManagement>
<plugins>
+ <plugin>
+ <groupId>org.eluder.coveralls</groupId>
+ <artifactId>coveralls-maven-plugin</artifactId>
+ <version>4.3.0</version>
+ <configuration>
+ <jacocoReports>
+ <jacocoReport>code-coverage/target/jacoco-merged-reports/jacoco.xml</jacocoReport>
+ </jacocoReports>
+ <sourceEncoding>UTF-8</sourceEncoding>
+ <sourceDirectories>
+ <!-- put all source folders not in src/main/java here-->
+ <sourceDirectory>antlr/target/generated-sources/antlr4</sourceDirectory>
+ <sourceDirectory>thrift/target/generated-sources/thrift</sourceDirectory>
+ <sourceDirectory>spark-iotdb-connector/src/main/scala</sourceDirectory>
+ <sourceDirectory>spark-tsfile/src/main/scala</sourceDirectory>
+ </sourceDirectories>
+ </configuration>
+ <!-- JDK11 removes the following libs. We have to add them-->
+ <dependencies>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-core</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.3.0</version>
+ </dependency>
+ </dependencies>
+ </plugin>
<!--
Strange things usually happen if you run with a too low Java version.
This plugin not only checks the minimum java version of 1.8, but also
@@ -1115,9 +1151,31 @@
</plugins>
</build>
</profile>
+ <!-- enable site-->
+ <!-- use `mvn package -P site -pl site` to compile the site module only -->
+ <profile>
+ <id>site</id>
+ <modules>
+ <module>site</module>
+ </modules>
+ </profile>
+ <profile>
+ <id>client-cpp</id>
+ <!-- we set client-cpp as true to enable the client-cpp-example-->
+ <properties>
+ <client-cpp>true</client-cpp>
+ </properties>
+ <modules>
+ <module>compile-tools</module>
+ <module>client-cpp</module>
+ </modules>
+ </profile>
<!-- code coverage for ut and it, and then merge them together.-->
<profile>
<id>code-coverage</id>
+ <modules>
+ <module>code-coverage</module>
+ </modules>
<build>
<plugins>
<!-- Jacoco is a code coverage analysis plugin when tests run.
@@ -1163,7 +1221,7 @@
<goal>prepare-agent</goal>
</goals>
<configuration>
- <destFile>${project.build.directory}/jacoco-unit-tests.exec</destFile>
+ <destFile>${project.build.directory}/${project.build.finalName}-jacoco-unit-tests.exec</destFile>
<propertyName>surefire.jacoco.args</propertyName>
</configuration>
</execution>
@@ -1176,7 +1234,7 @@
<goal>check</goal>
</goals>
<configuration>
- <dataFile>${project.build.directory}/jacoco-unit-tests.exec</dataFile>
+ <dataFile>${project.build.directory}/${project.build.finalName}-jacoco-unit-tests.exec</dataFile>
<outputDirectory>${project.build.directory}/jacoco-unit-reports</outputDirectory>
</configuration>
</execution>
@@ -1188,7 +1246,7 @@
<goal>prepare-agent</goal>
</goals>
<configuration>
- <destFile>${project.build.directory}/jacoco-integration-tests.exec</destFile>
+ <destFile>${project.build.directory}/${project.build.finalName}-jacoco-integration-tests.exec</destFile>
<propertyName>failsafe.jacoco.args</propertyName>
</configuration>
</execution>
@@ -1200,7 +1258,7 @@
<goal>check</goal>
</goals>
<configuration>
- <dataFile>${project.build.directory}/jacoco-integration-tests.exec</dataFile>
+ <dataFile>${project.build.directory}/${project.build.finalName}-jacoco-integration-tests.exec</dataFile>
<outputDirectory>${project.build.directory}/jacoco-integration-reports</outputDirectory>
</configuration>
</execution>
@@ -1219,7 +1277,7 @@
</includes>
</fileSet>
</fileSets>
- <destFile>${project.build.directory}/merged.exec</destFile>
+ <destFile>${project.build.directory}/${project.build.finalName}-merged.exec</destFile>
</configuration>
</execution>
<execution>
@@ -1230,7 +1288,8 @@
<goal>check</goal>
</goals>
<configuration>
- <dataFile>${project.build.directory}/merged.exec</dataFile>
+ <dataFile>${project.build.directory}/${project.build.finalName}-merged.exec</dataFile>
+ <outputDirectory>${project.build.directory}/jacoco-merged-reports</outputDirectory>
</configuration>
</execution>
</executions>
@@ -1264,24 +1323,11 @@
<!-- upload code coverage report to coveralls.io-->
<!-- to enable coveralls locally, you need to get the repoToken from https://coveralls.io/github/apache/iotdb.
use `mvn post-integration-test -Pcode-coverage -DrepoToken=TOKEN`-->
- <!-- enable site-->
- <!-- use `mvn package -P site -pl site` to compile the site module only -->
<profile>
- <id>site</id>
- <modules>
- <module>site</module>
- </modules>
- </profile>
- <profile>
- <id>client-cpp</id>
- <!-- we set client-cpp as true to enable the client-cpp-example-->
+ <id>enforce</id>
<properties>
- <client-cpp>true</client-cpp>
+ <enforcer.skip>false</enforcer.skip>
</properties>
- <modules>
- <module>compile-tools</module>
- <module>client-cpp</module>
- </modules>
</profile>
</profiles>
</project>
diff --git a/server/pom.xml b/server/pom.xml
index 2591bec..d1ce0ef 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -297,5 +297,19 @@
<iotdb.ut.skip>true</iotdb.ut.skip>
</properties>
</profile>
+ <profile>
+ <id>only_test_server</id>
+ <activation>
+ <property>
+ <name>iotdb.test.only</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <properties>
+ <iotdb.test.skip>false</iotdb.test.skip>
+ <iotdb.ut.skip>false</iotdb.ut.skip>
+ <iotdb.it.skip>false</iotdb.it.skip>
+ </properties>
+ </profile>
</profiles>
</project>
diff --git a/service-rpc/pom.xml b/service-rpc/pom.xml
index f692814..83995c8 100644
--- a/service-rpc/pom.xml
+++ b/service-rpc/pom.xml
@@ -85,26 +85,6 @@
</archive>
</configuration>
</plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${maven.assembly.version}</version>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <!-- this is used for inheritance merges -->
- <phase>package</phase>
- <!-- bind to the packaging phase -->
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </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>
diff --git a/session/pom.xml b/session/pom.xml
index 4276223..4c68333 100644
--- a/session/pom.xml
+++ b/session/pom.xml
@@ -36,26 +36,6 @@
</properties>
<build>
<plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${maven.assembly.version}</version>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <!-- this is used for inheritance merges -->
- <phase>package</phase>
- <!-- bind to the packaging phase -->
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </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>
@@ -147,5 +127,32 @@
<session.ut.skip>true</session.ut.skip>
</properties>
</profile>
+ <profile>
+ <id>get-jar-with-dependencies</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>${maven.assembly.version}</version>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <!-- this is used for inheritance merges -->
+ <phase>package</phase>
+ <!-- bind to the packaging phase -->
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
diff --git a/thrift/pom.xml b/thrift/pom.xml
index 8ee3873..989bf85 100644
--- a/thrift/pom.xml
+++ b/thrift/pom.xml
@@ -74,26 +74,6 @@
</archive>
</configuration>
</plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${maven.assembly.version}</version>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <!-- this is used for inheritance merges -->
- <phase>package</phase>
- <!-- bind to the packaging phase -->
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</project>
diff --git a/tsfile/pom.xml b/tsfile/pom.xml
index e05e38a..b5e1370 100644
--- a/tsfile/pom.xml
+++ b/tsfile/pom.xml
@@ -97,26 +97,6 @@
</archive>
</configuration>
</plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${maven.assembly.version}</version>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <!-- this is used for inheritance merges -->
- <phase>package</phase>
- <!-- bind to the packaging phase -->
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </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>
@@ -173,5 +153,32 @@
<tsfile.ut.skip>true</tsfile.ut.skip>
</properties>
</profile>
+ <profile>
+ <id>get-jar-with-dependencies</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>${maven.assembly.version}</version>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <!-- this is used for inheritance merges -->
+ <phase>package</phase>
+ <!-- bind to the packaging phase -->
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
diff --git a/zeppelin-interpreter/pom.xml b/zeppelin-interpreter/pom.xml
index 0376060..fd7a718 100644
--- a/zeppelin-interpreter/pom.xml
+++ b/zeppelin-interpreter/pom.xml
@@ -117,26 +117,35 @@
<target>1.8</target>
</configuration>
</plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${maven.assembly.version}</version>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- </configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <!-- this is used for inheritance merges -->
- <phase>package</phase>
- <!-- bind to the packaging phase -->
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>get-jar-with-dependencies</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>${maven.assembly.version}</version>
+ <configuration>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <!-- this is used for inheritance merges -->
+ <phase>package</phase>
+ <!-- bind to the packaging phase -->
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>