This is an automated email from the ASF dual-hosted git repository. luigidemasi pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-kit.git
commit 32220f2fb0494a1e0ce0f90ed04a9f3eb212fa97 Author: Luigi De Masi <[email protected]> AuthorDate: Tue Dec 1 11:54:27 2026 +0100 Verify licensing coverage for Camel Kit distributions Include the project license and notice in all thin JARs. Preserve licensing for the Knowledge runner's native dependencies and identify the bundled model conversions. Keep the project notice once in each shaded binary. Require a primary license or version-specific reviewed terms for every runtime JAR. Exercise the missing-license and stale-version cases and document the packaging workflow and the GCC runtime release review. Co-authored-by: OpenAI Codex <[email protected]> --- CLAUDE.md | 4 +- .../skill-pack/src/main/resources/META-INF/LICENSE | 191 ++++++++++++++++ .../skill-pack/src/main/resources/META-INF/NOTICE | 5 + docs/modules/ROOT/pages/contributing.adoc | 22 ++ docs/releasing.md | 20 ++ .../src/main/legal/dependencies.tsv | 18 ++ kit/camel-kit-core/pom.xml | 5 - kit/camel-kit-ship-resolver/src/main/legal/LICENSE | 7 +- .../src/main/legal/dependencies.tsv | 10 + knowledge/mcp/src/main/legal/LICENSE | 16 +- knowledge/mcp/src/main/legal/NOTICE | 41 +++- knowledge/mcp/src/main/legal/dependencies.tsv | 82 +++++++ .../resources/LICENSES/LICENSE.googlebrotli.txt | 19 ++ .../src/main/resources/LICENSES/LICENSE.netty.txt | 202 +++++++++++++++++ .../resources/META-INF/licenses/djl-tokenizers.txt | 57 ++++- .../resources/META-INF/licenses/jna-libffi.txt | 21 ++ .../META-INF/licenses/mingw-w64-runtime.txt | 240 +++++++++++++++++++++ pom.xml | 27 +++ tools/BundleLicenses.java | 79 ++++++- tools/test_bundle_licenses.py | 71 ++++++ tools/verify_bundle_licenses.py | 33 ++- 21 files changed, 1144 insertions(+), 26 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index d67dfea8..ae596988 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -88,7 +88,9 @@ Work is finished only when all of these hold: 1. `./mvnw test -B` passes in every touched module; `./mvnw clean install -B` from root when changes span modules or touch skills/templates/`distribution.properties`. - After a plugin packaging or runtime dependency change, check the bundled licenses and run `python3 tools/verify_installed_plugin.py` against the installed JAR. + When a bundled runtime dependency changes, review the notices and version records in the module's `src/main/legal/`. + At `prepare-package`, `tools/BundleLicenses.java` assembles these with the licensing files from the runtime JARs. + After a full build, run `python3 tools/verify_bundle_licenses.py` and, for the plugin, `python3 tools/verify_installed_plugin.py`. 2. `./mvnw -Psourcecheck validate -B` passes (CI format gate). 3. Skill/template/trait change: `ShippedAssetStructureTest` passes. 4. New user-invocable skill: verify generated entry points for all eight agents and the command reference. diff --git a/docs/modules/ROOT/examples/skill-pack/src/main/resources/META-INF/LICENSE b/docs/modules/ROOT/examples/skill-pack/src/main/resources/META-INF/LICENSE new file mode 100644 index 00000000..72342a43 --- /dev/null +++ b/docs/modules/ROOT/examples/skill-pack/src/main/resources/META-INF/LICENSE @@ -0,0 +1,191 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to the Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no theory of + liability, whether in contract, strict liability, or tort + (including negligence or otherwise) arising in any way out of + the use or inability to use the Work (even if such Holder or other + party has been advised of the possibility of such damages), shall + any Contributor be liable to You for damages, including any direct, + indirect, special, incidental, or consequential damages of any + character arising as a result of this License or out of the use or + inability to use the Work (including but not limited to damages for + loss of goodwill, work stoppage, computer failure or malfunction, or + any and all other commercial damages or losses), even if such + Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2024 Luigi De Masi + + 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. diff --git a/docs/modules/ROOT/examples/skill-pack/src/main/resources/META-INF/NOTICE b/docs/modules/ROOT/examples/skill-pack/src/main/resources/META-INF/NOTICE new file mode 100644 index 00000000..4b8ae1eb --- /dev/null +++ b/docs/modules/ROOT/examples/skill-pack/src/main/resources/META-INF/NOTICE @@ -0,0 +1,5 @@ +Apache Camel Kit +Copyright 2026 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (https://www.apache.org/). diff --git a/docs/modules/ROOT/pages/contributing.adoc b/docs/modules/ROOT/pages/contributing.adoc index a1bf3ebd..cc6530d9 100644 --- a/docs/modules/ROOT/pages/contributing.adoc +++ b/docs/modules/ROOT/pages/contributing.adoc @@ -58,6 +58,28 @@ the host's terminal. `camel.cli.version` and `aesh.version` pin the CLI host/par `camel.main.version`, which controls generated integration defaults. See xref:getting-started.adoc#cli-host[host compatibility]. [[done]] +=== Licensing bundled dependencies + +The parent POM puts the project `LICENSE` and `NOTICE` in each module JAR. +For the CLI plugin, Ship Resolver and Knowledge runner, `tools/BundleLicenses.java` +runs at `prepare-package`. It inventories the resolved runtime JARs, copies their +original licensing files and collects their notices. The runner ships the resulting `LICENSE.txt` and +`NOTICE.txt` at its root. The shaded JARs use `META-INF/LICENSE` and `META-INF/NOTICE`. + +When adding or upgrading a bundled dependency, check the exact upstream release, +including native libraries, embedded code and model conversions. If its JAR lacks +a nonempty primary LICENSE or COPYING file, record the Maven coordinate, version +and applicable license section in the module's `src/main/legal/dependencies.tsv`. +Use `Apache-2.0` for dependencies covered by the project license, or reproduce +the upstream terms in `src/main/legal/LICENSE` and name the section in the table. +A section can use `\{version}` to match the reviewed release. +Record dependencies that need supplementary terms even when their JAR ships a license. +Keep upstream attributions in `src/main/legal/NOTICE` and any referenced files +in `src/main/resources`. Include the pack's own license in external pack JARs. + +Run `./mvnw -B clean install`, then `python3 tools/verify_bundle_licenses.py` +to check the files in the archives that users receive. + == Definition of done A change is finished when all of the following hold: diff --git a/docs/releasing.md b/docs/releasing.md index 89b2c7b7..b5e9cf02 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -27,6 +27,26 @@ Repeat the catalog checks for all shipped runtime profiles and the documented Re runner and results in `docs/modules/ROOT/pages/mcp.adoc` and update the unreleased entry in `CHANGELOG.md`. Generated integration pins are independent. +Build the full reactor and run `python3 tools/verify_bundle_licenses.py`. Inspect the candidate +JARs against the runtime dependencies and versioned records in each bundle's +`src/main/legal/dependencies.tsv`. The plugin and Ship Resolver ship their generated +license and notice under `META-INF/`. The Knowledge runner ships `LICENSE.txt` and +`NOTICE.txt` at its root. The contributor guide describes how to update the inputs +to `tools/BundleLicenses.java` when a dependency or bundled model changes. + +For a Knowledge release, include the Windows native libraries and their linkage in the +Camel PMC's review of the release candidate. DJL Tokenizers loads `libwinpthread-1.dll`, +`libgcc_s_seh-1.dll` and `libstdc++-6.dll` alongside `tokenizers.dll`. The C++ runtime +imports both other DLLs, and the GCC runtime imports winpthreads. The PE import table +of `tokenizers.dll` lists the Microsoft runtime. DJL explicitly loads the MinGW DLLs. +The runner reproduces +the GCC Runtime Library Exception, GPLv3 and MinGW-w64 runtime notices. Record the +PMC's determination about the combination in the release vote. If the ASF product +modules and the GCC runtime are not combined, the PMC should seek further guidance +from ASF Legal Affairs before distribution. +[ASF GCC Runtime Library Exception policy](https://www.apache.org/legal/resolved.html#gcc-exception) +and [DJL's Windows loader](https://github.com/deepjavalibrary/djl/blob/v0.36.0/extensions/tokenizers/src/main/java/ai/djl/huggingface/tokenizers/jni/LibUtils.java). + For Kit, install the candidate and run `python3 tools/verify_installed_plugin.py`. This resolves the published POM shape in an independent Maven project and checks the duplicate-pack diagnostic. Repeat the packaged migration and MCP checks with the candidate GAV on both Camel hosts when a module version changes: diff --git a/kit/camel-jbang-plugin-kit/src/main/legal/dependencies.tsv b/kit/camel-jbang-plugin-kit/src/main/legal/dependencies.tsv new file mode 100644 index 00000000..fa7ec2e0 --- /dev/null +++ b/kit/camel-jbang-plugin-kit/src/main/legal/dependencies.tsv @@ -0,0 +1,18 @@ +# Maven coordinate Reviewed version License or section of the binary LICENSE +com.ethlo.time:itu 1.14.0 Apache-2.0 +com.github.freva:ascii-table 1.9.0 ascii-table {version} +com.github.javaparser:javaparser-core 3.26.4 Apache-2.0 +com.networknt:json-schema-validator 2.0.4 Apache-2.0 +dev.tamboui:tamboui-annotations 0.1.0 TamboUI {version} +dev.tamboui:tamboui-core 0.1.0 TamboUI {version} +dev.tamboui:tamboui-image 0.1.0 TamboUI {version} +dev.tamboui:tamboui-jline3-backend 0.1.0 TamboUI {version} +dev.tamboui:tamboui-tui 0.1.0 TamboUI {version} +dev.tamboui:tamboui-widgets 0.1.0 TamboUI {version} +io.smallrye.common:smallrye-common-annotation 2.12.2 Apache-2.0 +io.smallrye.reactive:mutiny 2.9.2 Apache-2.0 +org.antlr:antlr4-runtime 4.11.1 ANTLR 4 runtime {version} +org.jboss.logging:jboss-logging 3.6.1.Final Apache-2.0 +org.jctools:jctools-core 4.0.5 Apache-2.0 +org.tomlj:tomlj 1.1.1 Apache-2.0 +org.yaml:snakeyaml 2.7 Apache-2.0 diff --git a/kit/camel-kit-core/pom.xml b/kit/camel-kit-core/pom.xml index 88223ea9..e39f2957 100644 --- a/kit/camel-kit-core/pom.xml +++ b/kit/camel-kit-core/pom.xml @@ -173,11 +173,6 @@ <build> <resources> - <resource> - <directory>${maven.multiModuleProjectDirectory}</directory> - <includes><include>LICENSE</include><include>NOTICE</include></includes> - <targetPath>META-INF</targetPath> - </resource> <resource> <directory>src/main/resources</directory> <filtering>false</filtering> diff --git a/kit/camel-kit-ship-resolver/src/main/legal/LICENSE b/kit/camel-kit-ship-resolver/src/main/legal/LICENSE index 5653b128..16dee15e 100644 --- a/kit/camel-kit-ship-resolver/src/main/legal/LICENSE +++ b/kit/camel-kit-ship-resolver/src/main/legal/LICENSE @@ -1,4 +1,4 @@ -This product bundles SLF4J (MIT), ASM (BSD-3-Clause) and two Eclipse Sisu +This product bundles the SLF4J API and NOP binding (MIT), ASM (BSD-3-Clause) and two Eclipse Sisu annotations (EPL-2.0). Their original notices follow. The Maven, HttpComponents, Commons and Plexus licensing files are listed below, including the additional licenses for code included by Plexus. @@ -38,7 +38,10 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -SLF4J 1.7.36 (API, NOP and JCL bridge), MIT +SLF4J JCL bridge (jcl-over-slf4j), Apache-2.0 +Copyright 2001-2004 The Apache Software Foundation. + +SLF4J 1.7.36 (API and NOP binding), MIT https://github.com/qos-ch/slf4j Copyright (c) 2004-2022 QOS.ch Sarl (Switzerland) diff --git a/kit/camel-kit-ship-resolver/src/main/legal/dependencies.tsv b/kit/camel-kit-ship-resolver/src/main/legal/dependencies.tsv new file mode 100644 index 00000000..3d334d7d --- /dev/null +++ b/kit/camel-kit-ship-resolver/src/main/legal/dependencies.tsv @@ -0,0 +1,10 @@ +# Maven coordinate Reviewed version License or section of the binary LICENSE +com.google.code.gson:gson 2.13.2 Apache-2.0 +com.google.errorprone:error_prone_annotations 2.41.0 Apache-2.0 +javax.inject:javax.inject 1 Apache-2.0 +org.codehaus.plexus:plexus-interpolation 1.29 Apache-2.0 +org.eclipse.sisu:org.eclipse.sisu.inject 0.9.0.M4 Eclipse Sisu Inject {version} +org.ow2.asm:asm 9.9 ASM {version} +org.slf4j:jcl-over-slf4j 1.7.36 Apache-2.0 +org.slf4j:slf4j-api 1.7.36 SLF4J {version} +org.slf4j:slf4j-nop 1.7.36 SLF4J {version} diff --git a/knowledge/mcp/src/main/legal/LICENSE b/knowledge/mcp/src/main/legal/LICENSE index 60621e0e..8bd31e9c 100644 --- a/knowledge/mcp/src/main/legal/LICENSE +++ b/knowledge/mcp/src/main/legal/LICENSE @@ -4,10 +4,20 @@ Vert.x. The shipped Jakarta APIs and Parsson include their respective EPL or EDL terms and notices in the JAR directories listed below. Their source JARs are available under the same coordinates on https://repo.maven.apache.org/maven2/. ONNX Runtime's native dependency notices are in ThirdPartyNotices.txt. -For the DJL Tokenizers native libraries, see META-INF/licenses/djl-tokenizers.txt -and the MinGW runtime licenses below. -The Granite embedding and MS MARCO MiniLM reranker models are Apache-2.0: +For the DJL 0.36.0 API and Tokenizers native libraries, see META-INF/licenses/djl-tokenizers.txt +and META-INF/licenses/mingw-w64-runtime.txt in addition to the winpthreads and +GCC runtime licenses below. JNA 5.8.0 includes libffi under the terms reproduced in +META-INF/licenses/jna-libffi.txt. +Sources of the MinGW-w64 runtime and JNA libffi notices: +https://github.com/mingw-w64/mingw-w64/blob/v5.0.2/COPYING.MinGW-w64-runtime/COPYING.MinGW-w64-runtime.txt +https://github.com/java-native-access/jna/blob/5.8.0/native/libffi/LICENSE + +The bundled Granite ONNX conversion and its original model are Apache-2.0: +https://huggingface.co/onnx-community/granite-embedding-small-english-r2-ONNX https://huggingface.co/ibm-granite/granite-embedding-small-english-r2 +The bundled MS MARCO MiniLM ONNX conversion identifies the following Apache-2.0 +base model. The conversion repository supplies no separate license declaration. +https://huggingface.co/Xenova/ms-marco-MiniLM-L-6-v2 https://huggingface.co/cross-encoder/ms-marco-MiniLM-L-6-v2 ONNX Runtime 1.19.0, MIT diff --git a/knowledge/mcp/src/main/legal/NOTICE b/knowledge/mcp/src/main/legal/NOTICE index e4ca5396..76a146db 100644 --- a/knowledge/mcp/src/main/legal/NOTICE +++ b/knowledge/mcp/src/main/legal/NOTICE @@ -128,6 +128,43 @@ Copyright 2006, 2010 The Apache Software Foundation. This product includes software developed at The Apache Software Foundation (https://www.apache.org/). -Brotli4j 1.16.0 +DJL API and Tokenizers +Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + +Brotli4j +=============== Brotli4j =============== + Copyright 2021, Aayush Atharva -This product includes Google Brotli and Netty ByteBuf. + + Brotli4j 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. + +========================================= + +Also, please refer to each LICENSE.<component>.txt file, which is located in +the 'LICENSES' directory of the distribution file, for the license terms of the +components that this product depends on. + +--------------------------------- +This product depends on 'Google Brotli'. License for the same can be obtained at: + + * LICENSE: + * LICENSES/LICENSE.googlebrotli.txt (MIT License) + +--------------------------------- +This product depends on 'Netty ByteBuf'. License for the same can be obtained at: + + * LICENSE: + * LICENSES/LICENSE.netty.txt (Apache License 2.0) + +--------------------------------- diff --git a/knowledge/mcp/src/main/legal/dependencies.tsv b/knowledge/mcp/src/main/legal/dependencies.tsv new file mode 100644 index 00000000..8fd6bd71 --- /dev/null +++ b/knowledge/mcp/src/main/legal/dependencies.tsv @@ -0,0 +1,82 @@ +# Maven coordinate Reviewed version License or section of the binary LICENSE +ai.djl.huggingface:tokenizers 0.36.0 DJL {version} +ai.djl:api 0.36.0 DJL {version} +com.aayushatharva.brotli4j:brotli4j 1.16.0 Google Brotli in Brotli4j {version} +com.aayushatharva.brotli4j:native-linux-aarch64 1.16.0 Google Brotli in Brotli4j {version} +com.aayushatharva.brotli4j:native-linux-armv7 1.16.0 Google Brotli in Brotli4j {version} +com.aayushatharva.brotli4j:native-linux-ppc64le 1.16.0 Google Brotli in Brotli4j {version} +com.aayushatharva.brotli4j:native-linux-riscv64 1.16.0 Google Brotli in Brotli4j {version} +com.aayushatharva.brotli4j:native-linux-s390x 1.16.0 Google Brotli in Brotli4j {version} +com.aayushatharva.brotli4j:native-linux-x86_64 1.16.0 Google Brotli in Brotli4j {version} +com.aayushatharva.brotli4j:native-osx-aarch64 1.16.0 Google Brotli in Brotli4j {version} +com.aayushatharva.brotli4j:native-osx-x86_64 1.16.0 Google Brotli in Brotli4j {version} +com.aayushatharva.brotli4j:native-windows-aarch64 1.16.0 Google Brotli in Brotli4j {version} +com.aayushatharva.brotli4j:native-windows-x86_64 1.16.0 Google Brotli in Brotli4j {version} +com.aayushatharva.brotli4j:service 1.16.0 Google Brotli in Brotli4j {version} +com.github.victools:jsonschema-generator 4.38.0 Apache-2.0 +com.google.code.gson:gson 2.13.2 Apache-2.0 +com.google.errorprone:error_prone_annotations 2.48.0 Apache-2.0 +com.microsoft.onnxruntime:onnxruntime 1.19.0 ONNX Runtime {version} +io.netty:netty-buffer 4.1.132.Final Netty {version} +io.netty:netty-codec 4.1.132.Final Netty {version} +io.netty:netty-codec-dns 4.1.132.Final Netty {version} +io.netty:netty-codec-haproxy 4.1.132.Final Netty {version} +io.netty:netty-codec-http 4.1.132.Final Netty {version} +io.netty:netty-codec-http2 4.1.132.Final Netty {version} +io.netty:netty-codec-socks 4.1.132.Final Netty {version} +io.netty:netty-common 4.1.132.Final Netty {version} +io.netty:netty-handler 4.1.132.Final Netty {version} +io.netty:netty-handler-proxy 4.1.132.Final Netty {version} +io.netty:netty-resolver 4.1.132.Final Netty {version} +io.netty:netty-resolver-dns 4.1.132.Final Netty {version} +io.netty:netty-transport 4.1.132.Final Netty {version} +io.netty:netty-transport-native-unix-common 4.1.132.Final Netty {version} +io.quarkiverse.mcp:quarkus-mcp-server-core 1.10.5 Apache-2.0 +io.quarkiverse.mcp:quarkus-mcp-server-http 1.10.5 Apache-2.0 +io.quarkiverse.mcp:quarkus-mcp-server-sse-client 1.10.5 Apache-2.0 +io.quarkiverse.mcp:quarkus-mcp-server-stdio 1.10.5 Apache-2.0 +io.quarkus.security:quarkus-security 2.3.2 Apache-2.0 +io.quarkus:quarkus-fs-util 1.3.0 Apache-2.0 +io.smallrye.certs:smallrye-private-key-pem-parser 0.9.2 Apache-2.0 +io.smallrye.common:smallrye-common-annotation 2.17.0 Apache-2.0 +io.smallrye.common:smallrye-common-classloader 2.17.0 Apache-2.0 +io.smallrye.common:smallrye-common-constraint 2.17.0 Apache-2.0 +io.smallrye.common:smallrye-common-cpu 2.17.0 Apache-2.0 +io.smallrye.common:smallrye-common-expression 2.17.0 Apache-2.0 +io.smallrye.common:smallrye-common-function 2.17.0 Apache-2.0 +io.smallrye.common:smallrye-common-io 2.17.0 Apache-2.0 +io.smallrye.common:smallrye-common-net 2.17.0 Apache-2.0 +io.smallrye.common:smallrye-common-os 2.17.0 Apache-2.0 +io.smallrye.common:smallrye-common-ref 2.17.0 Apache-2.0 +io.smallrye.common:smallrye-common-vertx-context 2.17.0 Apache-2.0 +io.smallrye.config:smallrye-config 3.16.0 Apache-2.0 +io.smallrye.config:smallrye-config-common 3.16.0 Apache-2.0 +io.smallrye.config:smallrye-config-core 3.16.0 Apache-2.0 +io.smallrye.reactive:mutiny 3.1.1 Apache-2.0 +io.smallrye.reactive:mutiny-smallrye-context-propagation 3.1.1 Apache-2.0 +io.smallrye.reactive:smallrye-mutiny-vertx-auth-common 3.21.6 Apache-2.0 +io.smallrye.reactive:smallrye-mutiny-vertx-bridge-common 3.21.6 Apache-2.0 +io.smallrye.reactive:smallrye-mutiny-vertx-core 3.21.6 Apache-2.0 +io.smallrye.reactive:smallrye-mutiny-vertx-runtime 3.21.6 Apache-2.0 +io.smallrye.reactive:smallrye-mutiny-vertx-uri-template 3.21.6 Apache-2.0 +io.smallrye.reactive:smallrye-mutiny-vertx-web 3.21.6 Apache-2.0 +io.smallrye.reactive:smallrye-mutiny-vertx-web-common 3.21.6 Apache-2.0 +io.smallrye.reactive:vertx-mutiny-generator 3.21.6 Apache-2.0 +io.smallrye:smallrye-context-propagation 2.3.0 Apache-2.0 +io.smallrye:smallrye-context-propagation-api 2.3.0 Apache-2.0 +io.smallrye:smallrye-context-propagation-storage 2.3.0 Apache-2.0 +io.smallrye:smallrye-fault-tolerance-vertx 6.10.1 Apache-2.0 +io.vertx:vertx-auth-common 4.5.26 Apache-2.0 +io.vertx:vertx-bridge-common 4.5.26 Apache-2.0 +io.vertx:vertx-codegen 4.5.26 Apache-2.0 +io.vertx:vertx-core 4.5.26 Apache-2.0 +io.vertx:vertx-uri-template 4.5.26 Apache-2.0 +io.vertx:vertx-web 4.5.26 Apache-2.0 +io.vertx:vertx-web-common 4.5.26 Apache-2.0 +net.java.dev.jna:jna 5.8.0 JNA {version} +org.crac:crac 1.5.0 CRaC {version} +org.jboss.logging:jboss-logging 3.6.3.Final Apache-2.0 +org.jboss.logmanager:jboss-logmanager 3.2.1.Final Apache-2.0 +org.jboss.slf4j:slf4j-jboss-logmanager 2.0.2.Final Apache-2.0 +org.jctools:jctools-core 4.0.5 Apache-2.0 +org.wildfly.common:wildfly-common 2.0.1 Apache-2.0 diff --git a/knowledge/mcp/src/main/resources/LICENSES/LICENSE.googlebrotli.txt b/knowledge/mcp/src/main/resources/LICENSES/LICENSE.googlebrotli.txt new file mode 100644 index 00000000..33b7cdd2 --- /dev/null +++ b/knowledge/mcp/src/main/resources/LICENSES/LICENSE.googlebrotli.txt @@ -0,0 +1,19 @@ +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/knowledge/mcp/src/main/resources/LICENSES/LICENSE.netty.txt b/knowledge/mcp/src/main/resources/LICENSES/LICENSE.netty.txt new file mode 100644 index 00000000..62589edd --- /dev/null +++ b/knowledge/mcp/src/main/resources/LICENSES/LICENSE.netty.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + https://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. diff --git a/knowledge/mcp/src/main/resources/META-INF/licenses/djl-tokenizers.txt b/knowledge/mcp/src/main/resources/META-INF/licenses/djl-tokenizers.txt index 90e71f2b..eb0b822c 100644 --- a/knowledge/mcp/src/main/resources/META-INF/licenses/djl-tokenizers.txt +++ b/knowledge/mcp/src/main/resources/META-INF/licenses/djl-tokenizers.txt @@ -1,7 +1,7 @@ Third-party licensing for the native libraries in DJL Tokenizers 0.36.0 Source and dependency versions: https://github.com/deepjavalibrary/djl/tree/v0.36.0/extensions/tokenizers/rust -Crate source archives: https://crates.io/crates/<crate>/<version>/download +Crate source archives: https://crates.io/api/v1/crates/<crate>/<version>/download The following notices cover dependencies for the shipped Linux, macOS and Windows CPU targets. For crates offering MIT or Apache-2.0, the Apache-2.0 @@ -1873,3 +1873,58 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +esaxx and sais-lite sources in esaxx-rs 0.1.10 (MIT) +https://crates.io/api/v1/crates/esaxx-rs/0.1.10/download + +/* + * esa.hxx + * Copyright (c) 2010 Daisuke Okanohara All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * sais.hxx for sais-lite + * Copyright (c) 2008-2009 Yuta Mori All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ diff --git a/knowledge/mcp/src/main/resources/META-INF/licenses/jna-libffi.txt b/knowledge/mcp/src/main/resources/META-INF/licenses/jna-libffi.txt new file mode 100644 index 00000000..4f0b7625 --- /dev/null +++ b/knowledge/mcp/src/main/resources/META-INF/licenses/jna-libffi.txt @@ -0,0 +1,21 @@ +libffi - Copyright (c) 1996-2020 Anthony Green, Red Hat, Inc and others. +See source files for details. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/knowledge/mcp/src/main/resources/META-INF/licenses/mingw-w64-runtime.txt b/knowledge/mcp/src/main/resources/META-INF/licenses/mingw-w64-runtime.txt new file mode 100644 index 00000000..b6fc7588 --- /dev/null +++ b/knowledge/mcp/src/main/resources/META-INF/licenses/mingw-w64-runtime.txt @@ -0,0 +1,240 @@ +MinGW-w64 runtime licensing +*************************** + +This program or library was built using MinGW-w64 and statically +linked against the MinGW-w64 runtime. Some parts of the runtime +are under licenses which require that the copyright and license +notices are included when distributing the code in binary form. +These notices are listed below. + + +======================== +Overall copyright notice +======================== + +Copyright (c) 2009, 2010, 2011, 2012, 2013 by the mingw-w64 project + +This license has been certified as open source. It has also been designated +as GPL compatible by the Free Software Foundation (FSF). + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions in source code must retain the accompanying copyright + notice, this list of conditions, and the following disclaimer. + 2. Redistributions in binary form must reproduce the accompanying + copyright notice, this list of conditions, and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + 3. Names of the copyright holders must not be used to endorse or promote + products derived from this software without prior written permission + from the copyright holders. + 4. The right to distribute this software or to use it for any purpose does + not give you the right to use Servicemarks (sm) or Trademarks (tm) of + the copyright holders. Use of them is covered by separate agreement + with the copyright holders. + 5. If any files are modified, you must cause the modified files to carry + prominent notices stating that you changed the files and the date of + any change. + +Disclaimer + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY EXPRESSED +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +======================================== +getopt, getopt_long, and getop_long_only +======================================== + +Copyright (c) 2002 Todd C. Miller <[email protected]> + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Sponsored in part by the Defense Advanced Research Projects +Agency (DARPA) and Air Force Research Laboratory, Air Force +Materiel Command, USAF, under agreement number F39502-99-1-0512. + + * * * * * * * + +Copyright (c) 2000 The NetBSD Foundation, Inc. +All rights reserved. + +This code is derived from software contributed to The NetBSD Foundation +by Dieter Baron and Thomas Klausner. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + +=============================================================== +gdtoa: Converting between IEEE floating point numbers and ASCII +=============================================================== + +The author of this software is David M. Gay. + +Copyright (C) 1997, 1998, 1999, 2000, 2001 by Lucent Technologies +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + + * * * * * * * + +The author of this software is David M. Gay. + +Copyright (C) 2005 by David M. Gay +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that the copyright notice and this permission notice and warranty +disclaimer appear in supporting documentation, and that the name of +the author or any of his current or former employers not be used in +advertising or publicity pertaining to distribution of the software +without specific, written prior permission. + +THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN +NO EVENT SHALL THE AUTHOR OR ANY OF HIS CURRENT OR FORMER EMPLOYERS BE +LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + + * * * * * * * + +The author of this software is David M. Gay. + +Copyright (C) 2004 by David M. Gay. +All Rights Reserved +Based on material in the rest of /netlib/fp/gdota.tar.gz, +which is copyright (C) 1998, 2000 by Lucent Technologies. + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name of Lucent or any of its entities +not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + + +========================= +Parts of the math library +========================= + +Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + +Developed at SunSoft, a Sun Microsystems, Inc. business. +Permission to use, copy, modify, and distribute this +software is freely granted, provided that this notice +is preserved. + + * * * * * * * + +Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + +Developed at SunPro, a Sun Microsystems, Inc. business. +Permission to use, copy, modify, and distribute this +software is freely granted, provided that this notice +is preserved. + + * * * * * * * + +FIXME: Cephes math lib +Copyright (C) 1984-1998 Stephen L. Moshier + +It sounds vague, but as to be found at +<http://lists.debian.org/debian-legal/2004/12/msg00295.html>, it gives an +impression that the author could be willing to give an explicit +permission to distribute those files e.g. under a BSD style license. So +probably there is no problem here, although it could be good to get a +permission from the author and then add a license into the Cephes files +in MinGW runtime. At least on follow-up it is marked that debian sees the +version a-like BSD one. As MinGW.org (where those cephes parts are coming +from) distributes them now over 6 years, it should be fine. + +=================================== +Headers and IDLs imported from Wine +=================================== + +Some header and IDL files were imported from the Wine project. These files +are prominent maked in source. Their copyright belongs to contributors and +they are distributed under LGPL license. + +Disclaimer + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. diff --git a/pom.xml b/pom.xml index 6625dfbb..ecd20a03 100644 --- a/pom.xml +++ b/pom.xml @@ -104,6 +104,29 @@ <module>knowledge</module> </modules> <build> + <plugins> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>3.4.0</version> + <executions> + <execution> + <id>project-license-and-notice</id> + <phase>process-resources</phase> + <goals><goal>copy-resources</goal></goals> + <configuration> + <outputDirectory>${project.build.outputDirectory}/META-INF</outputDirectory> + <resources> + <resource> + <directory>${maven.multiModuleProjectDirectory}</directory> + <includes><include>LICENSE</include><include>NOTICE</include></includes> + <filtering>false</filtering> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> <pluginManagement> <plugins> <plugin> @@ -115,6 +138,9 @@ <configuration> <target> <delete dir="${project.build.outputDirectory}/META-INF/bundled-licenses/${project.artifactId}"/> + <echoproperties destfile="${project.build.directory}/bundle-artifacts.properties"> + <propertyset><propertyref regex="^[^: ]+:[^: ]+:jar(:[^: ]+)?$"/></propertyset> + </echoproperties> <java sourcefile="${maven.multiModuleProjectDirectory}/tools/BundleLicenses.java" fork="true" failonerror="true"> <classpath refid="maven.runtime.classpath"/> <arg file="${maven.multiModuleProjectDirectory}"/> @@ -123,6 +149,7 @@ <arg value="${bundle.license.path}"/> <arg value="${bundle.notice.path}"/> <arg value="${project.artifactId}"/> + <arg file="${project.build.directory}/bundle-artifacts.properties"/> </java> </target> </configuration> diff --git a/tools/BundleLicenses.java b/tools/BundleLicenses.java index 477c4970..0c294350 100644 --- a/tools/BundleLicenses.java +++ b/tools/BundleLicenses.java @@ -1,13 +1,16 @@ import java.io.File; +import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; +import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.jar.JarFile; import java.util.regex.Pattern; @@ -17,6 +20,37 @@ class BundleLicenses { private static final Pattern LICENSE = Pattern.compile("(?i)(?:META-INF/)?(?:licenses?/[^/]+|licen[cs]e([.-][^/]+)?|copying(\\.[^/]+)?" + "|third[-_ ]?party[^/]*|(?:asl|lgpl|gpl)[-0-9.]+(\\.txt)?)"); + private static final Pattern PRIMARY_LICENSE = Pattern.compile("(?i)(?:META-INF/)?(?:licen[cs]e(?:\\.(?:txt|md))?|copying(?:\\.txt)?)"); + + private record ReviewedLicense(String version, String section) { + String verify(String id, String[] coordinate, Path jar, String supplement, Path legal) { + String classifier = coordinate.length == 4 ? "-" + coordinate[3] : ""; + String filename = coordinate[1] + "-" + version + classifier + ".jar"; + String heading = section.replace("{version}", version); + if (!jar.getFileName().toString().equals(filename) + || !(heading.equals("Apache-2.0") || supplement.contains(heading))) { + throw new IllegalArgumentException("Review " + legal + " for " + id + " (" + jar.getFileName() + + "): expected " + filename + " and license section " + heading); + } + return heading; + } + } + + private static Map<String, ReviewedLicense> readReviewedLicenses(Path legal) throws IOException { + Map<String, ReviewedLicense> reviewed = new HashMap<>(); + for (String line : Files.readAllLines(legal.resolve("dependencies.tsv"))) { + if (line.isBlank() || line.startsWith("#")) { + continue; + } + String[] fields = line.split("\t", -1); + if (fields.length != 3 || fields[1].isBlank() || fields[2].isBlank() + || reviewed.put(fields[0], new ReviewedLicense(fields[1], fields[2])) != null) { + throw new IllegalArgumentException("Invalid license record in " + legal + ": " + line); + } + } + return reviewed; + } + public static void main(String[] args) throws Exception { Path root = Path.of(args[0]); Path module = Path.of(args[1]); @@ -24,20 +58,38 @@ class BundleLicenses { Path license = output.resolve(args[3]); Path notice = output.resolve(args[4]); Path originals = output.resolve("META-INF/bundled-licenses").resolve(args[5]); + Path legal = module.resolve("src/main/legal"); + String supplement = Files.readString(legal.resolve("LICENSE")); + Map<String, ReviewedLicense> reviewed = readReviewedLicenses(legal); + Properties artifacts = new Properties(); + try (var in = Files.newInputStream(Path.of(args[6]))) { + artifacts.load(in); + } + Map<Path, String> coordinates = new HashMap<>(); + artifacts.forEach((key, file) -> coordinates.put(Path.of(file.toString()).toAbsolutePath().normalize(), key.toString())); StringBuilder inventory = new StringBuilder(Files.readString(root.resolve("LICENSE")).stripTrailing()) - .append("\n\n").append(Files.readString(module.resolve("src/main/legal/LICENSE"))); - String projectNotice = Files.readString(root.resolve("NOTICE")).strip(); + .append("\n\n").append(supplement); + String projectNotice = Files.readString(root.resolve("NOTICE")).replace("\r\n", "\n").strip(); Path extraNotice = module.resolve("src/main/legal/NOTICE"); - if (Files.exists(extraNotice)) { - projectNotice += "\n\n" + Files.readString(extraNotice).strip(); - } Map<String, List<String>> notices = new LinkedHashMap<>(); inventory.append("\nBundled runtime artifacts (paths are relative to the root of this archive):\n"); var classpath = Arrays.stream(System.getProperty("java.class.path").split(Pattern.quote(File.pathSeparator))) .map(Path::of).filter(Files::isRegularFile).sorted(Comparator.comparing(Path::getFileName)).toList(); int position = 0; for (Path path : classpath) { + String coordinate = coordinates.get(path.toAbsolutePath().normalize()); + if (coordinate == null) { + throw new IllegalArgumentException("No Maven coordinate for " + path); + } + String[] parts = coordinate.split(":"); + String id = parts[0] + ":" + parts[1] + (parts.length == 4 ? ":" + parts[3] : ""); inventory.append("\n").append(path.getFileName()).append("\n"); + ReviewedLicense record = reviewed.get(id); + if (record != null) { + String section = record.verify(id, parts, path, supplement, legal); + inventory.append(" Reviewed license: ").append(section).append("\n"); + } + boolean primaryLicense = false; // Maven coordinates from different groups can have identical JAR filenames. Path origin = originals.resolve(++position + "-" + path.getFileName()); try (var jar = new JarFile(path.toFile())) { @@ -53,21 +105,34 @@ class BundleLicenses { } try (var in = jar.getInputStream(entry)) { byte[] bytes = in.readAllBytes(); + if (PRIMARY_LICENSE.matcher(name).matches() && !new String(bytes, StandardCharsets.UTF_8).isBlank()) { + primaryLicense = true; + } Files.createDirectories(destination.getParent()); Files.write(destination, bytes); inventory.append(" ").append(output.relativize(destination).toString().replace(File.separatorChar, '/')) .append("\n"); if (isNotice) { - String text = new String(bytes, StandardCharsets.UTF_8).strip(); - if (!text.isEmpty() && !text.equals(projectNotice)) { + String text = new String(bytes, StandardCharsets.UTF_8).replace("\r\n", "\n").strip(); + if (text.equals(projectNotice) || text.startsWith(projectNotice + "\n")) { + text = text.substring(projectNotice.length()).stripLeading(); + } + if (!text.isEmpty()) { notices.computeIfAbsent(text, ignored -> new ArrayList<>()).add(path.getFileName().toString()); } } } } } + if (!primaryLicense && record == null) { + throw new IllegalArgumentException(id + " (" + path.getFileName() + + ") has no primary license. Review its terms and record them in " + legal); + } } StringBuilder attribution = new StringBuilder(projectNotice).append("\n"); + if (Files.exists(extraNotice)) { + attribution.append("\n").append(Files.readString(extraNotice).strip()).append("\n"); + } notices.forEach((text, jars) -> attribution.append("\n").append(String.join(", ", jars)).append("\n\n") .append(text).append("\n")); Files.createDirectories(license.getParent()); diff --git a/tools/test_bundle_licenses.py b/tools/test_bundle_licenses.py new file mode 100644 index 00000000..577604db --- /dev/null +++ b/tools/test_bundle_licenses.py @@ -0,0 +1,71 @@ +"""Exercise the bundle license gate with the same Maven coordinates used at package time.""" +import os +from pathlib import Path +import subprocess +import tempfile +import unittest +from zipfile import ZipFile + + +ROOT = Path(__file__).resolve().parents[1] + + +class BundleLicensesTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + temp = tempfile.TemporaryDirectory() + cls.addClassCleanup(temp.cleanup) + cls.classes = Path(temp.name) + subprocess.run(["javac", "-d", cls.classes, ROOT / "tools/BundleLicenses.java"], check=True) + + def setUp(self): + temp = tempfile.TemporaryDirectory() + self.addCleanup(temp.cleanup) + self.root = Path(temp.name) + self.legal = self.root / "src/main/legal" + self.legal.mkdir(parents=True) + (self.legal / "LICENSE").write_text("Fixture 1.0, MIT\n") + + def assemble(self, files, record="", version="1.0", group="example"): + jar = self.root / f"fixture-{version}.jar" + with ZipFile(jar, "w") as archive: + for name, contents in files.items(): + archive.writestr(name, contents) + (self.legal / "dependencies.tsv").write_text(record) + properties = self.root / "artifacts.properties" + properties.write_text(f"{group}\\:fixture\\:jar={jar.as_posix()}\n") + return subprocess.run(["java", "-cp", os.pathsep.join(map(str, [self.classes, jar])), "BundleLicenses", + ROOT, self.root, self.root / "output", "LICENSE", "NOTICE", "bundle", properties], + text=True, capture_output=True) + + def test_requires_a_primary_license_or_reviewed_coordinate(self): + for files in ({}, {"NOTICE": "an attribution"}, {"ThirdPartyNotices.txt": "embedded terms"}, + {"META-INF/LICENSE": " \n\t"}): + with self.subTest(files=files): + result = self.assemble(files) + self.assertNotEqual(result.returncode, 0) + self.assertIn("example:fixture (fixture-1.0.jar) has no primary license", result.stderr) + result = self.assemble({"META-INF/LICENSE.md": "Upstream terms"}) + self.assertEqual(result.returncode, 0, result.stderr) + + def test_review_binds_group_version_and_shipped_terms(self): + record = "example:fixture\t1.0\tFixture {version}, MIT" + result = self.assemble({}, record) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn("Reviewed license: Fixture 1.0, MIT", (self.root / "output/LICENSE").read_text()) + for version, section in (("2.0", record), ("1.0", record.replace("MIT", "BSD"))): + with self.subTest(version=version, record=section): + result = self.assemble({"COPYING": "Upstream terms"}, section, version) + self.assertNotEqual(result.returncode, 0) + self.assertIn("expected fixture-1.0.jar and license section", result.stderr) + result = self.assemble({}, record, group="other") + self.assertNotEqual(result.returncode, 0) + self.assertIn("other:fixture", result.stderr) + + def test_keeps_third_party_notice_from_a_nested_bundle(self): + project = (ROOT / "NOTICE").read_text().strip() + result = self.assemble({"LICENSE": "Upstream terms", "NOTICE": project + "\n\nA third-party notice"}) + self.assertEqual(result.returncode, 0, result.stderr) + notice = (self.root / "output/NOTICE").read_text() + self.assertEqual(notice.count(project), 1) + self.assertIn("A third-party notice", notice) diff --git a/tools/verify_bundle_licenses.py b/tools/verify_bundle_licenses.py index 052c7a2e..dc805489 100644 --- a/tools/verify_bundle_licenses.py +++ b/tools/verify_bundle_licenses.py @@ -1,5 +1,6 @@ """Check the license and notice shipped by each packager after a reactor build.""" from pathlib import Path +import re from zipfile import ZipFile import xml.etree.ElementTree as ET @@ -7,7 +8,8 @@ import xml.etree.ElementTree as ET ROOT = Path(__file__).resolve().parents[1] -def verify(module, license_path, notice_path, required_text, classifier=""): +def verify(module, license_path="META-INF/LICENSE", notice_path="META-INF/NOTICE", + required_text=(), classifier=""): module = ROOT / module pom = ET.parse(module / "pom.xml") artifact = pom.findtext("{*}artifactId") @@ -16,22 +18,43 @@ def verify(module, license_path, notice_path, required_text, classifier=""): with ZipFile(jar) as archive: license_text = archive.read(license_path).decode() notice = archive.read(notice_path).decode() - project_notice = (ROOT / "NOTICE").read_text().splitlines() - assert notice.splitlines()[:len(project_notice)] == project_notice, f"{jar}: missing project notice" + project_notice = (ROOT / "NOTICE").read_text().strip() + notice = notice.replace("\r\n", "\n") + assert notice.startswith(project_notice) and notice.count(project_notice) == 1, f"{jar}: expected one project notice" + if not required_text: + assert license_text.splitlines() == (ROOT / "LICENSE").read_text().splitlines(), f"{jar}: changed project license" + assert notice.strip() == project_notice, f"{jar}: changed project notice" + extra_notice = module / "src/main/legal/NOTICE" + if extra_notice.exists(): + assert extra_notice.read_text().strip() in notice, f"{jar}: missing supplemental notice" assert license_text.count("TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION") == 1, f"{jar}: expected one Apache license" for text in required_text: assert text in license_text, f"{jar}: missing {text}" + if required_text: + _, inventory = license_text.split("Bundled runtime artifacts (paths are relative to the root of this archive):\n") + for entry in inventory.strip().split("\n\n"): + name, *coverage = entry.splitlines() + assert name.endswith(".jar") and coverage, f"{jar}: uncovered dependency {name}" for line in license_text.splitlines(): if line.startswith(" META-INF/bundled-licenses/"): assert archive.getinfo(line.strip()).file_size, f"{jar}: empty {line.strip()}" + if classifier == "-runner": + resources = module / "src/main/resources" + references = re.findall(r"(?<![\w/-])(?:META-INF/licenses|LICENSES)/[\w.-]+\.txt\b", license_text + notice) + for name in set(references): + assert archive.read(name) == (resources / name).read_bytes(), f"{jar}: changed {name}" if __name__ == "__main__": - verify("kit/camel-kit-core", "META-INF/LICENSE", "META-INF/NOTICE", []) + for module in ("kit/camel-kit-core", "kit/camel-kit-graph", "kit/camel-kit-main", + "knowledge/schema", "knowledge/embedding", "knowledge/indexer", "knowledge/index"): + verify(module) verify("kit/camel-kit-ship-resolver", "META-INF/LICENSE", "META-INF/NOTICE", ["QOS.ch", "INRIA", "Sonatype", "/licenses/extreme.indiana.edu.license.TXT"]) verify("kit/camel-jbang-plugin-kit", "META-INF/LICENSE", "META-INF/NOTICE", ["Copyright TamboUI Contributors", "Copyright 2017-2026 freva", "The ANTLR Project", "/META-INF/thirdparty-LICENSE"]) verify("knowledge/mcp", "LICENSE.txt", "NOTICE.txt", - ["Microsoft Corporation", "Azul Systems", "/ThirdPartyNotices.txt", "/META-INF/NOTICE.md"], "-runner") + ["Microsoft Corporation", "Azul Systems", "/ThirdPartyNotices.txt", "/META-INF/NOTICE.md", + "META-INF/licenses/jna-libffi.txt", "META-INF/licenses/mingw-w64-runtime.txt", + "onnx-community/granite-embedding-small-english-r2-ONNX", "Xenova/ms-marco-MiniLM-L-6-v2"], "-runner")
