pom.xml 6.14 KB
<!--

    Copyright © 2016-2024 The Thingsboard Authors

    Licensed 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.thingsboard</groupId>
        <version>3.7.0</version>
        <artifactId>thingsboard</artifactId>
    </parent>
    <artifactId>msa</artifactId>
    <packaging>pom</packaging>

    <name>ThingsBoard Microservices</name>
    <url>https://thingsboard.io</url>

    <properties>
        <main.dir>${basedir}/..</main.dir>
        <docker.repo>thingsboard</docker.repo>
        <dockerfile.skip>true</dockerfile.skip>
        <blackBoxTests.skip>true</blackBoxTests.skip>
        <dockerfile-maven.version>1.4.13</dockerfile-maven.version>
        <docker.push-arm-amd-image.phase>none</docker.push-arm-amd-image.phase>
    </properties>

    <modules>
        <!--Modules order is important to speedup parallel build and avoid yarn pgk parallel execution-->
        <module>tb</module>
        <module>web-ui</module>
        <module>vc-executor</module>
        <module>vc-executor-docker</module>
        <module>tb-node</module>
        <module>transport</module>
        <module>js-executor</module>
        <module>monitoring</module>
    </modules>

    <profiles>
        <profile>
            <id>black-box-tests</id>
            <activation>
                <property>
                    <name>blackBoxTests.skip</name>
                    <value>false</value>
                </property>
            </activation>
            <modules>
                <module>black-box-tests</module>
            </modules>
        </profile>
        <profile>
            <id>push-docker-amd-arm-images</id>
            <activation>
                <property>
                    <name>push-docker-amd-arm-images</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>push-latest-docker-amd-arm-images</id>
                                <phase>${docker.push-arm-amd-image.phase}</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>docker</executable>
                                    <workingDirectory>${project.build.directory}</workingDirectory>
                                    <arguments>
                                        <argument>buildx</argument>
                                        <argument>build</argument>
                                        <argument>-t</argument>
                                        <argument>${docker.repo}/${docker.name}:latest</argument>
                                        <argument>--platform=linux/amd64,linux/arm64</argument>
                                        <argument>-o</argument>
                                        <argument>type=registry</argument>
                                        <argument>.</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>push-version-docker-amd-arm-images</id>
                                <phase>${docker.push-arm-amd-image.phase}</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>docker</executable>
                                    <workingDirectory>${project.build.directory}</workingDirectory>
                                    <arguments>
                                        <argument>buildx</argument>
                                        <argument>build</argument>
                                        <argument>-t</argument>
                                        <argument>${docker.repo}/${docker.name}:${project.version}</argument>
                                        <argument>--platform=linux/amd64,linux/arm64</argument>
                                        <argument>-o</argument>
                                        <argument>type=registry</argument>
                                        <argument>.</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <build>
        <extensions>
            <extension>
                <groupId>com.spotify</groupId>
                <artifactId>dockerfile-maven-extension</artifactId>
                <version>${dockerfile-maven.version}</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.spotify</groupId>
                    <artifactId>dockerfile-maven-plugin</artifactId>
                    <version>${dockerfile-maven.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>