| <?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| <modelVersion>4.0.0</modelVersion> |
| <parent> |
| <groupId>org.apache.iotdb</groupId> |
| <artifactId>iotdb-extras-parent</artifactId> |
| <version>2.0.4-SNAPSHOT</version> |
| <relativePath>../pom.xml</relativePath> |
| </parent> |
| <artifactId>iotdb-thingsboard-table</artifactId> |
| <name>IoTDB Extras: ThingsBoard Table</name> |
| <description>IoTDB table-session integration support for ThingsBoard storage experiments.</description> |
| <properties> |
| <maven.compiler.source>17</maven.compiler.source> |
| <maven.compiler.target>17</maven.compiler.target> |
| <maven.compiler.release>17</maven.compiler.release> |
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| <!-- |
| Version policy: this module overrides NO shared reactor versions. iotdb-session, tsfile |
| and guava are inherited from the parent reactor (2.0.5 / 2.1.1 / 32.1.2-jre), exactly like |
| the sibling spark / flink IoTDB connectors. The Table-Mode client API this module uses |
| (TableSessionPoolBuilder / ITableSessionPool, Tablet with ColumnCategory TAG/FIELD, |
| TSDataType, TableSessionPoolBuilder#enableCompression) is present in iotdb-session 2.0.5 / |
| tsfile 2.1.1 — the parent's native pairing — so a full-reactor build keeps a SINGLE tsfile |
| version across all connectors. The integration test exercises the real write path against |
| the apache/iotdb:2.0.8-standalone server (the 2.0.5 client / 2.0.8 server RPC path is |
| covered by the container ITs). |
| |
| The one deliberate override is jakarta.validation-api: this module deploys into |
| ThingsBoard 4.3.1.2, which runs on Spring Boot 3.5.14 / Spring 6 / JDK 17 (the jakarta.* |
| namespace). The build parent is Spring Boot 2.7 with jakarta.validation-api 2.0.2 (the |
| last release carrying the legacy javax.validation.* packages). We compile the @Validated |
| config against jakarta.validation-api 3.0.2 (jakarta.validation.* annotations) to match |
| the runtime host. The API is provided-scope; the Hibernate Validator provider is supplied |
| by the ThingsBoard runtime classpath, not bundled here. |
| --> |
| <jakarta.validation-api.version>3.0.2</jakarta.validation-api.version> |
| <junit.jupiter.version>5.10.2</junit.jupiter.version> |
| <lombok.version>1.18.42</lombok.version> |
| <!-- |
| Parent pins mockito 2.23.4 (parent pom note: "powermock is having issues with the newest |
| mockito versions"). This module has no PowerMock and is JUnit 5 / JDK 17 only, using |
| mockito-junit-jupiter which requires mockito 5.x; the override is module-local and |
| test-scoped, so it does not affect any reactor compile/runtime classpath. |
| --> |
| <mockito.version>5.21.0</mockito.version> |
| <testcontainers.version>1.21.3</testcontainers.version> |
| <thingsboard.version>4.3.1.2</thingsboard.version> |
| <maven.compiler.plugin.version>3.13.0</maven.compiler.plugin.version> |
| <maven.jar.plugin.version>3.3.0</maven.jar.plugin.version> |
| <maven.surefire.plugin.version>3.2.5</maven.surefire.plugin.version> |
| <maven.failsafe.plugin.version>3.2.5</maven.failsafe.plugin.version> |
| </properties> |
| <dependencies> |
| <dependency> |
| <groupId>org.apache.iotdb</groupId> |
| <artifactId>iotdb-session</artifactId> |
| <!-- version inherited from the parent reactor (iotdb.version = 2.0.5) --> |
| </dependency> |
| <dependency> |
| <groupId>com.google.guava</groupId> |
| <artifactId>guava</artifactId> |
| <!-- version inherited from the parent reactor (guava.version = 32.1.2-jre) --> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-core</artifactId> |
| <version>${spring.version}</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-beans</artifactId> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context</artifactId> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework.boot</groupId> |
| <artifactId>spring-boot-autoconfigure</artifactId> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>jakarta.validation</groupId> |
| <artifactId>jakarta.validation-api</artifactId> |
| <!-- explicit 3.0.2 (jakarta.* namespace) to match the ThingsBoard 4.3.x Spring Boot 3 |
| runtime host; see the version-policy comment in <properties> above --> |
| <version>${jakarta.validation-api.version}</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.projectlombok</groupId> |
| <artifactId>lombok</artifactId> |
| <version>${lombok.version}</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-api</artifactId> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.junit.jupiter</groupId> |
| <artifactId>junit-jupiter</artifactId> |
| <version>${junit.jupiter.version}</version> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <!-- test-scope only: the unit tests construct StatementExecutionException(TSStatus) with |
| a specific status code to exercise the retry / idempotency classification. TSStatus |
| lives in iotdb-thrift-commons (a transitive runtime dependency of iotdb-session); |
| declared here at test scope so it is a declared, test-only use. Version inherited |
| from the parent reactor (iotdb.version). --> |
| <groupId>org.apache.iotdb</groupId> |
| <artifactId>iotdb-thrift-commons</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework.boot</groupId> |
| <artifactId>spring-boot-test</artifactId> |
| <version>${spring-boot.version}</version> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.assertj</groupId> |
| <artifactId>assertj-core</artifactId> |
| <version>3.22.0</version> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.hibernate.validator</groupId> |
| <artifactId>hibernate-validator</artifactId> |
| <version>8.0.2.Final</version> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.mockito</groupId> |
| <artifactId>mockito-core</artifactId> |
| <version>${mockito.version}</version> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.mockito</groupId> |
| <artifactId>mockito-junit-jupiter</artifactId> |
| <version>${mockito.version}</version> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.testcontainers</groupId> |
| <artifactId>testcontainers</artifactId> |
| <version>${testcontainers.version}</version> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.testcontainers</groupId> |
| <artifactId>junit-jupiter</artifactId> |
| <version>${testcontainers.version}</version> |
| <scope>test</scope> |
| </dependency> |
| </dependencies> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <version>${maven.compiler.plugin.version}</version> |
| <configuration> |
| <release>${maven.compiler.release}</release> |
| <annotationProcessorPaths> |
| <path> |
| <groupId>org.projectlombok</groupId> |
| <artifactId>lombok</artifactId> |
| <version>${lombok.version}</version> |
| </path> |
| </annotationProcessorPaths> |
| </configuration> |
| <executions> |
| <execution> |
| <id>default-compile</id> |
| <configuration> |
| <!-- |
| Compile-only ThingsBoard surface (Strategy F). |
| ThingsBoard's dao/common artifacts are not published to Maven Central, so the |
| compile-only surface under src/provided supplies them at build time; these sources |
| are available only to javac and are excluded from the built jar below (see the |
| maven-jar-plugin org/thingsboard/** exclude). The real ThingsBoard classpath |
| provides the genuine types at runtime. Replace this source root with a |
| provided-scope org.thingsboard.common:data dependency if those artifacts become |
| resolvable from a configured repository. |
| --> |
| <compileSourceRoots> |
| <compileSourceRoot>${project.basedir}/src/main/java</compileSourceRoot> |
| <compileSourceRoot>${project.basedir}/src/provided/java</compileSourceRoot> |
| </compileSourceRoots> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-jar-plugin</artifactId> |
| <version>${maven.jar.plugin.version}</version> |
| <configuration> |
| <excludes> |
| <!-- |
| Exclude the compile-only ThingsBoard surface (src/provided) from the built jar so |
| the stub classes never shadow the real org.thingsboard types on the deployment |
| classpath. javac sees them at compile time; the artifact ships only the IoTDB DAO code. |
| --> |
| <exclude>org/thingsboard/**</exclude> |
| <exclude>org/apache/commons/**</exclude> |
| </excludes> |
| </configuration> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-surefire-plugin</artifactId> |
| <version>${maven.surefire.plugin.version}</version> |
| <executions> |
| <!-- |
| Surefire runs the unit tests (*Test.java) only. The iotdb-extras parent |
| also binds a surefire integration-tests execution as a stopgap, but the |
| connectors modules run integration tests via the failsafe plugin; this |
| module follows that convention in the iotdb-table-it profile, |
| so both the implicit default-test run and the inherited surefire |
| integration-tests execution are disabled here. |
| --> |
| <execution> |
| <id>default-test</id> |
| <phase>none</phase> |
| </execution> |
| <execution> |
| <id>integration-tests</id> |
| <phase>none</phase> |
| </execution> |
| <execution> |
| <id>unit-tests</id> |
| <goals> |
| <goal>test</goal> |
| </goals> |
| <phase>test</phase> |
| <configuration> |
| <includes> |
| <include>**/*Test.java</include> |
| </includes> |
| <excludes> |
| <exclude>**/*IT.java</exclude> |
| </excludes> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-dependency-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>check-dependencies</id> |
| <configuration> |
| <ignoredUnusedDeclaredDependencies> |
| <!-- Verified false positive: Guava future types are used by main DAO/writer code. --> |
| <ignoredUnusedDeclaredDependency>com.google.guava:guava</ignoredUnusedDeclaredDependency> |
| <!-- Verified false positive: TableSessionPoolBuilder is used to create the IoTDB table session pool. --> |
| <ignoredUnusedDeclaredDependency>org.apache.iotdb:iotdb-session</ignoredUnusedDeclaredDependency> |
| <!-- Test/runtime-only dependencies required by the unit and integration test classpath. --> |
| <ignoredUnusedDeclaredDependency>org.junit.jupiter:junit-jupiter</ignoredUnusedDeclaredDependency> |
| <ignoredUnusedDeclaredDependency>org.assertj:assertj-core</ignoredUnusedDeclaredDependency> |
| <ignoredUnusedDeclaredDependency>org.hibernate.validator:hibernate-validator</ignoredUnusedDeclaredDependency> |
| <ignoredUnusedDeclaredDependency>org.mockito:mockito-junit-jupiter</ignoredUnusedDeclaredDependency> |
| </ignoredUnusedDeclaredDependencies> |
| <ignoredUsedUndeclaredDependencies> |
| <!-- Transitive API surfaces intentionally supplied by the IoTDB and Spring Boot dependencies. --> |
| <ignoredUsedUndeclaredDependency>org.apache.iotdb:isession</ignoredUsedUndeclaredDependency> |
| <ignoredUsedUndeclaredDependency>org.apache.tsfile:tsfile</ignoredUsedUndeclaredDependency> |
| <ignoredUsedUndeclaredDependency>org.apache.tsfile:common</ignoredUsedUndeclaredDependency> |
| <ignoredUsedUndeclaredDependency>org.apache.iotdb:service-rpc</ignoredUsedUndeclaredDependency> |
| <ignoredUsedUndeclaredDependency>org.springframework.boot:spring-boot</ignoredUsedUndeclaredDependency> |
| <!-- Strategy F: org.apache.commons.lang3.tuple.Pair is a compile-only stub under |
| src/provided (the real AttributesDao.removeAllByEntityId returns |
| List<Pair<AttributeScope,String>>). commons-lang3 is NOT declared as a module |
| dependency: the stub is excluded from the built jar (org/apache/commons/**) and |
| the real commons-lang3 is supplied by the ThingsBoard runtime classpath. The |
| analyzer sees the transitive commons-lang3 jar on the test classpath and would |
| otherwise flag the Pair reference as used-undeclared. --> |
| <ignoredUsedUndeclaredDependency>org.apache.commons:commons-lang3</ignoredUsedUndeclaredDependency> |
| <!-- The junit-jupiter aggregate supplies junit-jupiter-api on the test classpath. --> |
| <ignoredUsedUndeclaredDependency>org.junit.jupiter:junit-jupiter-api</ignoredUsedUndeclaredDependency> |
| </ignoredUsedUndeclaredDependencies> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| <profiles> |
| <profile> |
| <id>iotdb-table-it</id> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-failsafe-plugin</artifactId> |
| <version>${maven.failsafe.plugin.version}</version> |
| <configuration> |
| <!-- |
| Run integration tests against target/classes rather than the packaged jar. |
| Strategy F excludes the compile-only ThingsBoard surface (org/thingsboard/**, |
| see maven-jar-plugin above) from the jar, so the default failsafe behaviour |
| of testing the artifact would fail to load the stub types (e.g. TsKvEntry) |
| that the standalone container IT constructs. |
| --> |
| <classesDirectory>${project.build.outputDirectory}</classesDirectory> |
| <includes> |
| <include>**/*IT.java</include> |
| </includes> |
| </configuration> |
| <executions> |
| <execution> |
| <id>run-integration-tests</id> |
| <phase>integration-test</phase> |
| <goals> |
| <goal>integration-test</goal> |
| </goals> |
| </execution> |
| <execution> |
| <id>verify-integration-tests</id> |
| <phase>verify</phase> |
| <goals> |
| <goal>verify</goal> |
| </goals> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| </profiles> |
| </project> |