Open-source IoT Platform - Device management, data collection, processing and visualization.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

465 lines
22 KiB

<!--
SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
SPDX-License-Identifier: BUSL-1.1
-->
<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>4.4.2-SNAPSHOT</version>
<artifactId>msa</artifactId>
</parent>
<groupId>org.thingsboard.msa</groupId>
<artifactId>web-report</artifactId>
<packaging>pom</packaging>
<name>Thingsboard Web Report Microservice</name>
<url>https://thingsboard.io</url>
<description>Report service for generating ThingsBoard reports</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.dir>${basedir}/../..</main.dir>
<docker.name>${tb.docker.id}-web-report</docker.name>
<pkg.name>tb-web-report</pkg.name>
<pkg.type>js</pkg.type>
<pkg.process-resources.phase>process-resources</pkg.process-resources.phase>
<pkg.package.phase>package</pkg.package.phase>
<sbom.package.phase>${pkg.package.phase}</sbom.package.phase>
<pkg.linux.dist>${project.build.directory}/package/linux</pkg.linux.dist>
<pkg.win.dist>${project.build.directory}/package/windows</pkg.win.dist>
<docker.push-arm-amd-image.phase>pre-integration-test</docker.push-arm-amd-image.phase>
<sbom.image.scanExclude></sbom.image.scanExclude>
</properties>
<dependencies>
<dependency>
<groupId>com.sun.winsw</groupId>
<artifactId>winsw</artifactId>
<classifier>bin</classifier>
<type>exe</type>
<scope>provided</scope>
</dependency>
<!--
Reactor-only ordering dep (NOT a real classpath dependency).
Forces `mvn -T<n>` to serialize this module after js-executor so that
no two `yarn install` / `yarn run pkg` invocations can overlap on
the same agent. Concurrent yarn 1.x processes share ~/.cache/yarn
and have intermittently produced `tsc: not found` failures during
yarn pkg (incomplete typescript extraction in node_modules).
The chain is: ui-ngx -> msa/web-ui -> msa/js-executor -> msa/web-report
(web-report is PE-only; the upstream CE chain ends at msa/js-executor).
type=pom + provided + wildcard exclusions keep nothing on the classpath.
-->
<dependency>
<groupId>org.thingsboard.msa</groupId>
<artifactId>js-executor</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<installDirectory>target</installDirectory>
<workingDirectory>${basedir}</workingDirectory>
<!-- Declared at plugin level so that it covers every execution of this plugin,
including the ones contributed by the profiles below. -->
<skip>${skip.ui.build}</skip>
</configuration>
<executions>
<execution>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-yarn</goal>
</goals>
<configuration>
<nodeVersion>v22.23.4</nodeVersion>
<yarnVersion>v1.22.22</yarnVersion>
</configuration>
</execution>
<execution>
<id>yarn install</id>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>install --non-interactive --check-files --network-concurrency 4 --network-timeout 100000 --mutex network</arguments>
</configuration>
</execution>
<execution>
<id>generate sbom</id>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<skip>${sbom.ui.skip}</skip>
<arguments>run sbom pkg:maven/${project.groupId}/${project.artifactId}@${project.version}</arguments>
</configuration>
</execution>
<execution>
<id>yarn pkg</id>
<goals>
<goal>yarn</goal>
</goals>
<phase>compile</phase>
<configuration>
<arguments>--mutex network run pkg</arguments>
</configuration>
</execution>
<execution>
<id>sbom check</id>
<goals>
<goal>yarn</goal>
</goals>
<phase>compile</phase>
<configuration>
<skip>${sbom.ui.skip}</skip>
<arguments>run sbom-check</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/node_modules</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-src-root</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/src</outputDirectory>
<resources>
<resource>
<directory>${basedir}</directory>
<includes>
<include>package.json</include>
<include>yarn.lock</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.thingsboard</groupId>
<artifactId>gradle-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>read-bundled-versions</id>
<phase>${sbom.package.phase}</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${project.build.directory}/sbom/bundled-versions.properties</file>
</files>
<!-- "sbom check" writes the file only when SBOMs are made -->
<quiet>true</quiet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>build-docker-image</id>
<phase>pre-integration-test</phase>
<goals><goal>exec</goal></goals>
<configuration>
<skip>${dockerfile.skip}</skip>
<executable>docker</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<arguments>
<argument>build</argument>
<argument>-t</argument>
<argument>${docker.repo}/${docker.name}:latest</argument>
<argument>.</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>tag-docker-image</id>
<phase>pre-integration-test</phase>
<goals><goal>exec</goal></goals>
<configuration>
<skip>${dockerfile.skip}</skip>
<executable>docker</executable>
<arguments>
<argument>tag</argument>
<argument>${docker.repo}/${docker.name}:latest</argument>
<argument>${docker.repo}/${docker.name}:${docker.version.tag}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<!-- After exec-maven-plugin: the image SBOM is made in the phase that pushes the image, once it is pushed -->
<plugin>
<groupId>org.thingsboard</groupId>
<artifactId>sbom-maven-plugin</artifactId>
<executions>
<execution>
<id>sbom-metadata</id>
<configuration>
<targetFile>${project.build.directory}/sbom/tb-web-report.cdx.json</targetFile>
<skip>${skip.ui.build}</skip>
</configuration>
</execution>
<execution>
<id>package-sbom</id>
<configuration>
<sourceFile>${project.build.directory}/sbom/tb-web-report.cdx.json</sourceFile>
<skip>${skip.ui.build}</skip>
<packages combine.self="override">
<package>
<id>deb</id>
<file>${project.build.directory}/${pkg.name}.deb</file>
<purl>pkg:deb/thingsboard/${pkg.name}@${pkg.version}-1?arch=amd64</purl>
<skip>${pkg.skip.deb}</skip>
</package>
<package>
<id>rpm</id>
<file>${project.build.directory}/${pkg.name}.rpm</file>
<purl>pkg:rpm/thingsboard/${pkg.name}@${pkg.version}-1?arch=x86_64</purl>
<skip>${pkg.skip.rpm}</skip>
</package>
<package>
<id>zip</id>
<file>${project.build.directory}/${pkg.name}-windows.zip</file>
<purl>pkg:generic/thingsboard/${pkg.name}-windows@${project.version}</purl>
<skip>${pkg.skip.zip}</skip>
</package>
</packages>
<components combine.children="append">
<component>
<type>application</type>
<name>node</name>
<version>${node.linux.version}</version>
<description>Node.js runtime embedded in the ${pkg.name} executable by pkg (base binary from yao-pkg/pkg-fetch).</description>
<purl>pkg:github/nodejs/node@v${node.linux.version}?os=linux</purl>
<cpe>cpe:2.3:a:nodejs:node.js:${node.linux.version}:*:*:*:*:*:*:*</cpe>
<license>MIT</license>
<supplier>
<name>OpenJS Foundation</name>
<urls>
<url>https://nodejs.org</url>
</urls>
</supplier>
<packages>
<package>deb</package>
<package>rpm</package>
</packages>
</component>
<component>
<type>application</type>
<name>node</name>
<version>${node.windows.version}</version>
<description>Node.js runtime embedded in the ${pkg.name} executable by pkg (base binary from yao-pkg/pkg-fetch).</description>
<purl>pkg:github/nodejs/node@v${node.windows.version}?os=windows</purl>
<cpe>cpe:2.3:a:nodejs:node.js:${node.windows.version}:*:*:*:*:*:*:*</cpe>
<license>MIT</license>
<supplier>
<name>OpenJS Foundation</name>
<urls>
<url>https://nodejs.org</url>
</urls>
</supplier>
<packages>
<package>zip</package>
</packages>
</component>
<component>
<type>application</type>
<name>chromium</name>
<version>${chromium.version}</version>
<description>Chromium snapshot build of the Chromium project, used to render reports.</description>
<purl>pkg:generic/chromium/chromium@${chromium.version}?os=linux</purl>
<cpe>cpe:2.3:a:google:chrome:${chromium.version}:*:*:*:*:*:*:*</cpe>
<license>BSD-3-Clause</license>
<supplier>
<name>The Chromium Authors</name>
<urls>
<url>https://www.chromium.org</url>
</urls>
</supplier>
<file>${pkg.linux.dist}/chromium/chrome</file>
<packages>
<package>deb</package>
<package>rpm</package>
</packages>
</component>
<component>
<type>application</type>
<name>chromium</name>
<version>${chromium.version}</version>
<description>Chromium snapshot build of the Chromium project, used to render reports.</description>
<purl>pkg:generic/chromium/chromium@${chromium.version}?os=windows</purl>
<cpe>cpe:2.3:a:google:chrome:${chromium.version}:*:*:*:*:*:*:*</cpe>
<license>BSD-3-Clause</license>
<supplier>
<name>The Chromium Authors</name>
<urls>
<url>https://www.chromium.org</url>
</urls>
</supplier>
<file>${pkg.win.dist}/chromium/chrome.exe</file>
<packages>
<package>zip</package>
</packages>
</component>
</components>
</configuration>
</execution>
<execution>
<id>image-sbom</id>
<configuration>
<components combine.self="override">
<component>
<sbom>${project.build.directory}/sbom/tb-web-report.cdx.json</sbom>
<installDir>${pkg.installFolder}</installDir>
</component>
</components>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>yarn-start</id>
<activation>
<property>
<name>yarn-start</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<installDirectory>target</installDirectory>
<workingDirectory>${basedir}</workingDirectory>
</configuration>
<executions>
<execution>
<id>yarn start</id>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>start</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>push-docker-image</id>
<activation>
<property>
<name>push-docker-image</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>push-latest-docker-image</id>
<phase>pre-integration-test</phase>
<goals><goal>exec</goal></goals>
<configuration>
<executable>docker</executable>
<arguments>
<argument>push</argument>
<argument>${docker.repo}/${docker.name}:latest</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>push-version-docker-image</id>
<phase>pre-integration-test</phase>
<goals><goal>exec</goal></goals>
<configuration>
<executable>docker</executable>
<arguments>
<argument>push</argument>
<argument>${docker.repo}/${docker.name}:${docker.version.tag}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
<id>jenkins</id>
<name>Jenkins Repository</name>
<url>https://repo.jenkins-ci.org/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>