Browse Source

Merge branch 'lts-4.4' into rc

pull/16164/head
Viacheslav Klimov 2 months ago
parent
commit
df0dccac6b
  1. 4
      TEST_FAST.md
  2. 21
      msa/js-executor/pom.xml
  3. 36
      msa/pom.xml
  4. 3
      msa/web-ui/pom.xml
  5. 133
      pom.xml
  6. 11
      ui-ngx/pom.xml

4
TEST_FAST.md

@ -42,10 +42,12 @@ Use `-Dpkg.skip=true` to skip all packaging at once (equivalent to all four flag
|----------------------------|-------------------------------------------|--------------------------------------------------------------|
| `-Dpkg.skip=true` | All of the below (bootjar + deb + rpm + zip) | Yes |
| `-Dpkg.skip.bootjar=true` | `spring-boot:repackage` (`*-boot.jar`) | Yes — tests use the regular `.jar`, not the fat boot jar |
| `-Dpkg.skip.deb=true` | Gradle `buildDeb` + Maven `attach-artifact` | Yes — MSA docker modules copy the DEB from `target/` directly |
| `-Dpkg.skip.deb=true` | Gradle `buildDeb` | Yes — MSA docker modules copy the DEB from `target/` directly |
| `-Dpkg.skip.rpm=true` | Gradle `buildRpm` | Yes — no test depends on the RPM |
| `-Dpkg.skip.zip=true` | `maven-assembly-plugin` Windows ZIP | Yes — no test depends on the ZIP |
`-Dskip.yarn=true` and `-Dskip.ui.build=true` imply `-Dpkg.skip=true`: packages built without the UI are incomplete.
## Testcontainers compatibility with the Docker API workaround
In case your tests failed to run testcontainers due to unsupported Docker API version

21
msa/js-executor/pom.xml

@ -30,6 +30,13 @@
<pkg.package.phase>package</pkg.package.phase>
<pkg.linux.dist>${project.build.directory}/package/linux</pkg.linux.dist>
<pkg.win.dist>${project.build.directory}/package/windows</pkg.win.dist>
<!-- The `yarn test` execution has to be skipped when tests are skipped and also when the
yarn build as a whole is skipped: with `yarn install` skipped there is no node_modules
to run the tests from. Maven has no boolean OR, so skip.yarn is used as the default
here (honoured both from the command line and from a pom property) and the
skip-yarn-test profile below folds in maven.test.skip, which is only ever passed on
the command line. -->
<yarn.test.skip>${skip.yarn}</yarn.test.skip>
<docker.push-arm-amd-image.phase>pre-integration-test</docker.push-arm-amd-image.phase>
</properties>
@ -112,7 +119,7 @@
</goals>
<phase>test</phase>
<configuration>
<skip>${maven.test.skip}</skip>
<skip>${yarn.test.skip}</skip>
<arguments>--mutex network run test</arguments>
</configuration>
</execution>
@ -206,6 +213,18 @@
</plugins>
</build>
<profiles>
<profile>
<id>skip-yarn-test</id>
<activation>
<property>
<name>maven.test.skip</name>
<value>true</value>
</property>
</activation>
<properties>
<yarn.test.skip>true</yarn.test.skip>
</properties>
</profile>
<profile>
<id>yarn-start</id>
<activation>

36
msa/pom.xml

@ -55,10 +55,7 @@
</modules>
<profiles>
<!-- Mirror of the root-pom skip-deb profile. Required because Maven resolves
child <properties> entries (pkg.deb.phase=package above) with higher priority
than profile properties from a parent POM. Redeclaring the profile here ensures
pkg.deb.phase=none wins when -Dpkg.skip.deb=true is passed. -->
<!-- Activated by -Dpkg.skip.deb=true. Skips the .deb enforce/copy executions. -->
<profile>
<id>skip-deb</id>
<activation>
@ -71,9 +68,9 @@
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
<!-- Mirror of the root-pom skip-pkg profile. Same precedence reason as skip-deb above:
pkg.deb.phase=package in this POM's <properties> would win over the parent profile,
so we must redeclare it here to ensure pkg.deb.phase=none when -Dpkg.skip=true. -->
<!-- Activated by -Dpkg.skip=true. Needed alongside skip-deb because profile activation
only sees CLI/system properties, so pkg.skip.deb=true set by the root skip-pkg
profile does not activate skip-deb. -->
<profile>
<id>skip-pkg</id>
<activation>
@ -86,6 +83,31 @@
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
<!-- Mirror the root skip-pkg-without-* profiles: no .deb is built when the UI build is skipped. -->
<profile>
<id>skip-pkg-without-yarn</id>
<activation>
<property>
<name>skip.yarn</name>
<value>true</value>
</property>
</activation>
<properties>
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
<profile>
<id>skip-pkg-without-ui-build</id>
<activation>
<property>
<name>skip.ui.build</name>
<value>true</value>
</property>
</activation>
<properties>
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
<profile>
<id>black-box-tests</id>
<activation>

3
msa/web-ui/pom.xml

@ -60,6 +60,9 @@
<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>

133
pom.xml

@ -28,20 +28,27 @@
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<main.dir>${basedir}</main.dir>
<!-- Set to true to skip only the UI builds: the Angular application in ui-ngx and the
`yarn run pkg` launcher of msa/web-ui. It deliberately does NOT
cover msa/js-executor, whose yarn install and sandbox tests keep running.
frontend-maven-plugin reads skip.yarn itself, so that property cannot be narrowed to a
subset of the modules; this one can, and it defaults to skip.yarn so that
-Dskip.yarn=true still skips every yarn invocation in the project exactly as before.
Either flag also skips all packaging (see the skip-pkg-without-* profiles). -->
<skip.ui.build>${skip.yarn}</skip.ui.build>
<pkg.process-resources.phase>none</pkg.process-resources.phase>
<pkg.package.phase>none</pkg.package.phase>
<!-- Use -Dpkg.skip=true to skip all packaging at once (bootjar + deb + rpm + zip).
Individual flags below can be set independently for finer control. -->
<!-- Set to true to skip spring-boot:repackage (the boot jar, i.e. the *-boot.jar artifact).
The boot jar is the mandatory input to Gradle buildDeb; skipping it also prevents
the .deb from being produced. Any msa/* module that depends on a .deb artifact
(e.g. msa/tb-node depends on application:deb) will FAIL when the boot jar and
the .deb from being produced. Any msa/* module that copies a .deb
(e.g. msa/tb-node copies application's .deb) will FAIL when the boot jar and
consequently the .deb are missing. Each packaging module overrides this to false. -->
<pkg.skip.bootjar>false</pkg.skip.bootjar>
<!-- Set to true to skip Gradle buildDeb and suppress the Maven attach-artifact goal
that registers the .deb with the reactor. msa/* docker modules copy the .deb
directly from the upstream module's target/ directory (not from .m2), and their
copy execution is bound to ${pkg.deb.phase}, so they are silently skipped too. -->
<!-- Set to true to skip Gradle buildDeb. msa/* docker modules copy the .deb directly
from the upstream module's target/ directory, and their copy execution is bound to
${pkg.deb.phase} (see msa/pom.xml), so they are silently skipped too. -->
<pkg.skip.deb>false</pkg.skip.deb>
<!-- Set to true to skip Gradle buildRpm. No Maven reactor module depends on the RPM
artifact, so this flag can be toggled freely without breaking downstream modules. -->
@ -50,11 +57,6 @@
module depends on the ZIP artifact, so this flag can be toggled freely without
breaking downstream modules. -->
<pkg.skip.zip>false</pkg.skip.zip>
<!-- Internal: resolved phase for the build-helper attach-deb execution. Overridden to
"none" by the skip-deb profile when pkg.skip.deb=true so the goal is silently
skipped instead of failing on a non-existent .deb file. Packaging modules inherit
"package" via pkg.package.phase; msa/* docker modules set it explicitly in msa/pom.xml. -->
<pkg.deb.phase>${pkg.package.phase}</pkg.deb.phase>
<pkg.user>thingsboard</pkg.user>
<pkg.implementationTitle>${project.name}</pkg.implementationTitle>
<pkg.unixLogFolder>/var/log/${pkg.name}</pkg.unixLogFolder>
@ -217,31 +219,46 @@
</properties>
</profile>
<!-- Activated by -Dpkg.skip.deb=true. Sets the attach-artifact lifecycle phase to "none"
so the build-helper goal that registers the .deb with the Maven reactor is silently
skipped. Without this, the goal would fail because the .deb file does not exist. -->
<!-- Activated by -Dpkg.skip=true. Convenience alias that sets all four skip flags at once. -->
<profile>
<id>skip-deb</id>
<id>skip-pkg</id>
<activation>
<property>
<name>pkg.skip.deb</name>
<name>pkg.skip</name>
<value>true</value>
</property>
</activation>
<properties>
<pkg.deb.phase>none</pkg.deb.phase>
<pkg.skip.bootjar>true</pkg.skip.bootjar>
<pkg.skip.deb>true</pkg.skip.deb>
<pkg.skip.rpm>true</pkg.skip.rpm>
<pkg.skip.zip>true</pkg.skip.zip>
</properties>
</profile>
<!-- Activated by -Dpkg.skip=true. Convenience alias that sets all four skip flags at
once. Also sets pkg.deb.phase=none directly because Maven profile activation is
evaluated against CLI/system properties only — a property set inside another profile
cannot trigger a second profile, so skip-deb would not fire automatically. -->
<!-- Packages built without the UI are incomplete (and the JS Windows ZIPs fail on the missing
launcher), so skipping the UI build skips all packaging too. One profile per flag because
activation only sees CLI/system properties, not the skip.ui.build default. -->
<profile>
<id>skip-pkg</id>
<id>skip-pkg-without-yarn</id>
<activation>
<property>
<name>pkg.skip</name>
<name>skip.yarn</name>
<value>true</value>
</property>
</activation>
<properties>
<pkg.skip.bootjar>true</pkg.skip.bootjar>
<pkg.skip.deb>true</pkg.skip.deb>
<pkg.skip.rpm>true</pkg.skip.rpm>
<pkg.skip.zip>true</pkg.skip.zip>
</properties>
</profile>
<profile>
<id>skip-pkg-without-ui-build</id>
<activation>
<property>
<name>skip.ui.build</name>
<value>true</value>
</property>
</activation>
@ -250,7 +267,6 @@
<pkg.skip.deb>true</pkg.skip.deb>
<pkg.skip.rpm>true</pkg.skip.rpm>
<pkg.skip.zip>true</pkg.skip.zip>
<pkg.deb.phase>none</pkg.deb.phase>
</properties>
</profile>
@ -540,21 +556,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/logback.xml</exclude>
</excludes>
<archive>
<manifestEntries>
<Implementation-Title>${pkg.implementationTitle}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
@ -567,6 +568,8 @@
<skip>${pkg.skip.bootjar}</skip>
<mainClass>${pkg.mainClass}</mainClass>
<classifier>boot</classifier>
<!-- Input for Gradle packaging only; don't install/deploy the fat jar -->
<attach>false</attach>
<layout>ZIP</layout>
<executable>true</executable>
<excludeDevtools>true</excludeDevtools>
@ -581,7 +584,6 @@
<execution>
<goals>
<goal>repackage</goal>
<goal>build-info</goal>
</goals>
</execution>
</executions>
@ -643,28 +645,9 @@
</goals>
<configuration>
<skipAssembly>${pkg.skip.zip}</skipAssembly>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-deb</id>
<phase>${pkg.deb.phase}</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>${project.build.directory}/${pkg.name}.deb</file>
<type>deb</type>
<classifier>deb</classifier>
</artifact>
</artifacts>
<!-- Picked up from target/; don't install/deploy the Windows zip.
Set on the execution so other assemblies (e.g. rule nodes) stay attached. -->
<attach>false</attach>
</configuration>
</execution>
</executions>
@ -720,6 +703,18 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${jar-plugin.version}</version>
<!-- Outside the packaging profile: activating any other root profile (e.g. skip-pkg) disables it -->
<configuration>
<excludes>
<exclude>**/logback.xml</exclude>
</excludes>
<archive>
<manifestEntries>
<Implementation-Title>${pkg.implementationTitle}</Implementation-Title>
<Implementation-Version>${project.version}</Implementation-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -730,6 +725,20 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<!-- Outside the packaging profile: activating any other root profile (e.g. skip-pkg) disables it,
and ProjectInfo needs build-info.properties at runtime -->
<execution>
<id>build-info</id>
<goals>
<goal>build-info</goal>
</goals>
<configuration>
<!-- Overrides the packaging profile's pkg.skip.bootjar skip -->
<skip>false</skip>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.thingsboard</groupId>

11
ui-ngx/pom.xml

@ -37,6 +37,9 @@
<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>
@ -71,6 +74,14 @@
</filesets>
</configuration>
</plugin>
<plugin>
<!-- Only consumed in-reactor by application and msa/web-ui -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<profiles>

Loading…
Cancel
Save