Skip to content

chore: licence compliance for published artifacts - #2

Open
dskarzh wants to merge 3 commits into
thingsboard:thingsboardfrom
dskarzh:chore/license-compliance
Open

chore: licence compliance for published artifacts#2
dskarzh wants to merge 3 commits into
thingsboard:thingsboardfrom
dskarzh:chore/license-compliance

Conversation

@dskarzh

@dskarzh dskarzh commented Jul 31, 2026

Copy link
Copy Markdown

Attribution and licence hygiene for this fork, same series as thingsboard/tbel#51, thingsboard/protobuf-dynamic#4 and thingsboard/swagger-ui#1.

Targets thingsboard, not mainmain tracks upstream and carries none of the fork's work.

Changes

  • Mark the file we have modified. The fork's entire source delta against upstream v2.8.8 is one line in PropertyResolverUtils.java (LOGGER.warnLOGGER.trace). Apache-2.0 §4(b) requires modified files to carry prominent notices stating that they were changed, so it gets one — the same wording used in the other three repos. The upstream header is left untouched and no ThingsBoard copyright is applied to upstream code. Everything else in the fork delta is version strings (2.8.82.8.8TB in poms and test fixtures), where the TB suffix itself is the distinguishing mark, and the new springdoc-swagger-ui module, which is new work rather than a modification.

  • Preserve the Swagger UI attribution in the published webjar. springdoc-swagger-ui builds its jar by downloading the thingsboard/swagger-ui archive and moving only dist/ into place — the upstream NOTICE (SmartBear Software's attribution, which §4(d) requires to travel with distributions) was unpacked and then left behind, so springdoc-swagger-ui-2.8.8TB.jar shipped without it. The antrun step now also copies NOTICE into META-INF/.

  • Ship the licence texts in the sources and javadoc jars. The main jars already carry META-INF/LICENSE and META-INF/COPYRIGHT via the existing copy-resources execution (left untouched), but that copies straight into target/classes, which neither maven-source-plugin nor maven-javadoc-plugin looks at — the published -sources and -javadoc jars contained no licence at all (verified against the 2.8.8TB artifacts on Maven Central). Two additions in the parent pom fix this for every module:

    • build-helper-maven-plugin:add-resource registers LICENSE/COPYRIGHT as a project resource, which the sources jar picks up. add-resource rather than a <resources> declaration because declaring <resources> would replace the filtered resource configuration inherited from spring-boot-starter-parent for every module.
    • a copy-resources execution in the gpg profile stages them into target/reports/apidocs/META-INF at prepare-package, before javadoc:jar runs. That path is where the javadoc plugin version managed by spring-boot-starter-parent 3.4.8 (3.10.1) writes its output — verified empirically, not assumed.
  • Bump <swagger-ui.version> to 5.21.0TB2 — the tag suggested in chore: licence compliance for published artifacts swagger-ui#1 for the release that will include the NOTICE addendum and the per-file notices added there.

    [!IMPORTANT]
    That tag does not exist yet, so this branch does not fully build until chore: licence compliance for published artifacts swagger-ui#1 is merged and tagged: the springdoc-swagger-ui antrun downloads archive/5.21.0TB2.zip, which currently 404s, and with the version bump below, ci-profile builds of the ui modules cannot resolve org.thingsboard:springdoc-swagger-ui:2.8.8TB2 until the webjar has been built (-Pgpg) or released. If a different tag name is chosen over there, adjust this property to match. Modules that do not depend on the webjar build fine.

  • Bump the version to 2.8.8TB2 (last commit) — 2.8.8TB is on Maven Central and immutable, so the release this PR feeds needs a new version anyway; setting it here means merging and deploying is all that is left. The same commit updates <scm><tag> to v2.8.8TB2, fixing en passant that it previously named a tag that has never existed in this repo (tags stop at v2.4.0TB).

  • Fix the urls in the pom metadata. Project <url> pointed at https://springdoc.org/, which is upstream's site, not this repository; <scm> used SSH urls for connection/url (kept for developerConnection, where SSH is appropriate). The springdoc-swagger-ui <licenses><url> pointed at the upstream GitHub repo instead of the licence text.

  • Make the licence declarations machine-readable and describe the fork in the README. The same pass chore: licence compliance for published artifacts swagger-ui#1 got: the modification notice on PropertyResolverUtils.java gains an SPDX-FileCopyrightText tag, so the modification copyright is machine-readable while staying scoped to the modifications; the ThingsBoard-authored springdoc-swagger-ui/pom.xml — new work, which until now declared its licence only through its <licenses> block — carries the short-form SPDX header (SPDX-FileCopyrightText: Copyright 2024 ThingsBoard, Inc. + SPDX-License-Identifier: Apache-2.0); and the README, which documented upstream's packages and sponsors, is replaced with a fork-descriptive one. Its delta list against upstream 2.8.8 doubles as the §4(b) modification notice for the changed files that cannot reasonably carry one in-file — the poms and test fixtures whose only change is the version string. All three files scan to exactly Apache-2.0 with both copyright statements parsed. The module's <licenses><name> is also switched from Apache 2.0 to the SPDX full name Apache License 2.0, matching the tbel fork, so the declared licence in the published pom maps to SPDX without guesswork.

  • Publish releases to the ThingsBoard repository. Deployment went to Maven Central through the central-publishing-maven-plugin, which registers itself as an extension and takes over mvn deploy. That plugin is removed and a <distributionManagement> block pointing at repo.thingsboard.io/artifactory/libs-release-public takes its place — the same publishing setup as other ThingsBoard-hosted libraries. Signing and the sources/javadoc packaging in the gpg profile are unchanged; the deploying machine needs a thingsboard-public-repo server entry in its settings.xml instead of the central one. The platform already resolves dependencies from that repository, so consumers need no change.

Verification

Built with mvn clean package -Pgpg -DskipTests on JDK 17 (-Pgpg so the reactor matches the released module set, and so the sources/javadoc jars are actually produced). The full-reactor build ran before the version bumps, i.e. against the 5.21.0TB archive — the bumped versions cannot fully build until the tag exists, and nothing about the packaging differs. After the bumps, the modules that do not depend on the webjar were rebuilt at 2.8.8TB2 to confirm the poms are consistent. Every produced jar was inspected:

jar before (2.8.8TB on Central) after
main jars LICENSE, COPYRIGHT unchanged
-sources jars nothing LICENSE, COPYRIGHT
-javadoc jars nothing LICENSE, COPYRIGHT
springdoc-swagger-ui jar LICENSE, COPYRIGHT + NOTICE

The test suite was not run: the only source change is a comment, the rest is packaging and metadata. Note for anyone building locally: the build requires an older JDK — kotlin-maven-plugin 1.9.25 in springdoc-openapi-starter-common fails to parse the JDK 25 version string. That predates this PR.

Follow-up needed from someone with write access

  1. Merge chore: licence compliance for published artifacts swagger-ui#1 and tag it 5.21.0TB2 (or adjust the property here if another name is chosen).
  2. Merge this PR.
  3. Deploy the release — the version is already set to 2.8.8TB2, so no version work is needed. Tag it v2.8.8TB2, which is what the pom's <scm><tag> now declares. Note the destination is now repo.thingsboard.io (see the publishing bullet), so the deploying machine's settings.xml needs the thingsboard-public-repo credentials rather than the Sonatype ones.

One thing worth checking before that release: the webjar resource path embeds the version (META-INF/resources/webjars/swagger-ui/5.21.0TB2/ after the bump), so it is worth grepping consumers for the literal old path in case anything hardcodes it.

@dskarzh dskarzh left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

Reviewed 3 changed files in Licence compliance for the published artifacts. Left 4 comment(s) inline.

The compliance approach is sound: the modification notice wording matches the sibling repos, the NOTICE copy fails loudly if the file is missing from the archive, and the empirical verification table in the description covers the packaging outcomes well. The inline comments are about robustness of the two new licence-staging mechanisms (both fail silently under certain conditions) and two consistency nits.

Additional findings

These observations are about existing code outside the PR's diff — spotted while reading surrounding context.

  • pom.xml:65 — The central-publishing-maven-plugin.version property is set to 0.7.0 but is never referenced: the plugin declaration in the gpg profile (line 287) hardcodes 0.8.0. One of the two should go — as it stands the property misleads anyone bumping the version.

This review was auto-generated. Findings may contain errors — please verify before applying changes.

Comment thread pom.xml Outdated
Comment thread pom.xml
Comment thread pom.xml Outdated
Comment thread pom.xml
@dskarzh dskarzh changed the title Licence compliance for the published artifacts chore: licence compliance for published artifacts Jul 31, 2026
@dskarzh
dskarzh force-pushed the chore/license-compliance branch from 642d6ac to f23cc96 Compare July 31, 2026 13:52

@dskarzh dskarzh left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review summary

Re-reviewed chore: licence compliance for published artifacts — verified 4 finding(s) from previous review.

Status Count
✅ Resolved 2
💬 Acknowledged 2

All previous findings have been addressed.

Finding details

  • pom.xml:142${maven.multiModuleProjectDirectory} resolved to the invocation directory (no .mvn marker), so in-module builds would silently ship jars without the licence files — Fixed in code: both new executions now use ${basedir}/.., the same repo-root resolution as the pre-existing copy execution, which is anchored to the module's position rather than the invocation directory. Verified in-module by the author.
  • 💬 pom.xml:154 — the new add-resource execution overlaps the pre-existing copy-resources execution, with divergent repo-root resolution — Developer: "existing execution kept deliberately to stay close to upstream; both mechanisms now resolve the root the same way, and the remaining overlap writes identical bytes to the same path."
  • pom.xml:125build-helper-maven-plugin version hardcoded inline instead of following the pom's properties-block convention — Fixed in code.
  • 💬 pom.xml:246 — the javadoc staging path mirrors an internal default of maven-javadoc-plugin 3.10.1 and will silently break if a spring-boot parent bump moves it — Developer: "deliberate; exposure is narrow, releases are rare, manual, and jar contents are inspected, and the coupling is documented in the pom comment."

Also reviewed the fix commits (repo-root resolution change, the version property, and the 2.8.8TB2 bump) — no new issues. The bump is consistent across all 21 poms with no leftover 2.8.8TB/5.21.0TB references, <scm><tag> matches, and ${basedir}/.. resolves to the repo root for every module in the gpg release profile (the nested test modules resolve it one level short, but they are not part of the released module set, matching the pre-existing execution's behavior).

One note: the previous review's body-level observation — the unused central-publishing-maven-plugin.version property (0.7.0) vs. the version hardcoded in the gpg profile (0.8.0) — is still present. It concerns existing code outside this PR's diff, so deferring it is reasonable, just flagging that it was not picked up.


This re-review was auto-generated. Findings may contain errors — please verify before applying changes.

@dskarzh dskarzh left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review summary

Reviewed 21 changed files in chore: licence compliance for published artifacts. Left 2 comments inline.

The packaging changes consistently propagate the TB2 versions and add the intended licence and attribution resources. The remaining comments concern the accuracy of the modification notice and reproducibility of the Swagger UI input used for an immutable Maven release. Previously discussed and resolved review topics were excluded.


This review was auto-generated. Findings may contain errors — please verify before applying changes.

Comment thread pom.xml
@dskarzh
dskarzh force-pushed the chore/license-compliance branch 6 times, most recently from 50960f0 to cad032a Compare August 4, 2026 13:28
dskarzh added 3 commits August 4, 2026 16:30
The one upstream source file this fork modifies,
PropertyResolverUtils.java, now carries a modification notice with an
SPDX-FileCopyrightText tag, and the ThingsBoard-authored
springdoc-swagger-ui module pom carries the short-form SPDX header
(SPDX-FileCopyrightText plus SPDX-License-Identifier: Apache-2.0).
The README is replaced with a fork-descriptive one whose delta list
against upstream 2.8.8 serves as the Apache-2.0 section 4(b) notice
for the changed files that cannot reasonably carry one in-file — the
poms and test fixtures whose only change is the version string.

The published artifacts are completed: the springdoc-swagger-ui
antrun step now copies the Swagger UI NOTICE into the webjar's
META-INF, and the licence texts are staged into the sources and
javadoc jars of every module (the main jars already carried them).

The swagger-ui archive consumed by the webjar packaging is bumped to
the 5.21.0TB2 tag, and the pom metadata urls point at this repository
instead of upstream's site.
Releases were pushed to Maven Central through the
central-publishing-maven-plugin, which registers itself as an
extension and takes over mvn deploy. The plugin is removed and a
distributionManagement block pointing at
repo.thingsboard.io/artifactory/libs-release-public takes its place,
the same publishing setup as other ThingsBoard-hosted libraries, so a
plain mvn deploy -Pgpg now targets the ThingsBoard repository. The
credentials come from the thingsboard-public-repo server entry in the
deploying machine's settings.xml.

Signing, sources and javadoc packaging in the gpg profile are
unchanged. The unused central-publishing-maven-plugin.version
property is left in place to keep the upstream delta minimal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant