diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..2a6f29a --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,25 @@ +version: 2.1 + +orbs: + qqq-orb: kingsrook/qqq-orb@0.6.8 + +commands: + configure-package-install: + steps: + - run: + name: Keep package installation unattended + command: | + # These build machines are discarded after the job. + sudo install -d /etc/needrestart/conf.d + printf '%s\n' '$nrconf{restart} = "l";' | sudo tee /etc/needrestart/conf.d/99-qqq-ci.conf >/dev/null + +workflows: + test_only: + jobs: + - qqq-orb/mvn_test_only: + pre-steps: + - configure-package-install + context: [qqq-maven-registry-credentials] + filters: + tags: + ignore: /.*/ diff --git a/CLAUDE.md b/CLAUDE.md index 51d71bb..c215e91 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -24,7 +24,6 @@ Key facts from that review: `QInstance.setAuthentication(...)` (removed; use `withInstanceDefaultAuthentication` / `registerAuthenticationProvider`), and the pom pins Java 17 vs 4.0's Java 21 floor. -- Licensing is split: LICENSE/NOTICE say Apache-2.0, but source headers, the - pom header, and the checkstyle-enforced header template - (`checkstyle/license.txt`) are still AGPL-3.0/Kingsrook; pom has no - `` block. +- The historical license split is resolved in the current source: LICENSE/NOTICE, + source headers, the pom header and `` metadata, and + `checkstyle/license.txt` consistently declare Apache-2.0. diff --git a/README.md b/README.md index c47adaa..25ce0f2 100644 --- a/README.md +++ b/README.md @@ -53,4 +53,21 @@ For migration changes, see the [QQQ 4.0 migration guide](https://github.com/QRun ## License -See [LICENSE](LICENSE) and [NOTICE](NOTICE). +The packaged application includes byte-for-byte copies of this repository's +`LICENSE` and `NOTICE` under `META-INF/qqq-app-starter/`. This namespace avoids +overwriting dependency license/notice entries during shading. Main/test resources +and Maven shared resources for source/Javadoc archives include the same copies. + +After packaging, use Python 3 to check every produced archive explicitly: + +```bash +mvn -DskipTests clean package +python3 scripts/check-packaged-notices.py --root . --prefix META-INF/qqq-app-starter target/*.jar +``` + +This is a packaging-only check; existing runtime tests, reviews and release +requirements still apply. The guard rejects absent archives, missing/duplicate +entries and altered notice bytes. It checks the supplied archives; it does not +generate additional classifiers or run automatically in the publishing workflow. + +Licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE). diff --git a/checkstyle/config.xml b/checkstyle/config.xml index c6a1604..bcc7f53 100644 --- a/checkstyle/config.xml +++ b/checkstyle/config.xml @@ -6,18 +6,17 @@ ~ contact@kingsrook.com ~ https://github.com/Kingsrook/ ~ - ~ This program is free software: you can redistribute it and/or modify - ~ it under the terms of the GNU Affero General Public License as - ~ published by the Free Software Foundation, either version 3 of the - ~ License, or (at your option) any later version. + ~ 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 ~ - ~ This program 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 Affero General Public License for more details. + ~ https://www.apache.org/licenses/LICENSE-2.0 ~ - ~ You should have received a copy of the GNU Affero General Public License - ~ along with this program. If not, see . + ~ 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. --> . + * 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/pom.xml b/pom.xml index d943815..4975347 100644 --- a/pom.xml +++ b/pom.xml @@ -6,18 +6,17 @@ ~ contact@kingsrook.com ~ https://github.com/Kingsrook/ ~ - ~ This program is free software: you can redistribute it and/or modify - ~ it under the terms of the GNU Affero General Public License as - ~ published by the Free Software Foundation, either version 3 of the - ~ License, or (at your option) any later version. + ~ 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 ~ - ~ This program 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 Affero General Public License for more details. + ~ https://www.apache.org/licenses/LICENSE-2.0 ~ - ~ You should have received a copy of the GNU Affero General Public License - ~ along with this program. If not, see . + ~ 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. --> qqq-app-starter 0.1-SNAPSHOT + + + Apache License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0 + repo + + + @@ -123,7 +130,51 @@ + + + src/main/resources + + + ${project.build.directory}/maven-shared-archive-resources + + + + + src/test/resources + + + ${project.build.directory}/maven-shared-archive-resources + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.4.0 + + + package-root-notices + generate-resources + + copy-resources + + + ${project.build.directory}/maven-shared-archive-resources/META-INF/qqq-app-starter + + + ${project.basedir} + false + + LICENSE + NOTICE + + + + + + + maven-assembly-plugin diff --git a/scripts/check-packaged-notices.py b/scripts/check-packaged-notices.py new file mode 100644 index 0000000..e583d31 --- /dev/null +++ b/scripts/check-packaged-notices.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +"""Verify exact project notices in explicitly listed Maven archives.""" + +import argparse +from pathlib import Path +import sys +from zipfile import BadZipFile, ZipFile + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--root", type=Path, required=True, + help="consumer repository containing LICENSE and NOTICE") + parser.add_argument("--prefix", default="META-INF", + help="directory containing the project's archive copies") + parser.add_argument("archives", type=Path, nargs="+") + args = parser.parse_args() + expected = {name: (args.root / name).read_bytes() for name in ("LICENSE", "NOTICE")} + failures = [] + for archive in args.archives: + try: + with ZipFile(archive) as jar: + for name, content in expected.items(): + entry = f"{args.prefix.rstrip('/')}/{name}" + if jar.namelist().count(entry) != 1: + failures.append(f"{archive}: expected exactly one {entry}") + elif jar.read(entry) != content: + failures.append(f"{archive}: {entry} differs from root {name}") + except (OSError, BadZipFile) as error: + failures.append(f"{archive}: {error}") + if failures: + print("\n".join(failures), file=sys.stderr) + return 1 + print(f"PASS: exact LICENSE/NOTICE in {len(args.archives)} archives") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/src/main/java/com/kingsrook/qqq/starterapp/StarterAppCli.java b/src/main/java/com/kingsrook/qqq/starterapp/StarterAppCli.java index 6090cdb..e0f01db 100644 --- a/src/main/java/com/kingsrook/qqq/starterapp/StarterAppCli.java +++ b/src/main/java/com/kingsrook/qqq/starterapp/StarterAppCli.java @@ -5,18 +5,17 @@ * contact@kingsrook.com * https://github.com/Kingsrook/ * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. + * 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 * - * This program 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 Affero General Public License for more details. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * 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. */ package com.kingsrook.qqq.starterapp; diff --git a/src/main/java/com/kingsrook/qqq/starterapp/StarterAppJavalinServer.java b/src/main/java/com/kingsrook/qqq/starterapp/StarterAppJavalinServer.java index 43d528d..4bfce43 100644 --- a/src/main/java/com/kingsrook/qqq/starterapp/StarterAppJavalinServer.java +++ b/src/main/java/com/kingsrook/qqq/starterapp/StarterAppJavalinServer.java @@ -5,18 +5,17 @@ * contact@kingsrook.com * https://github.com/Kingsrook/ * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. + * 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 * - * This program 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 Affero General Public License for more details. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * 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. */ package com.kingsrook.qqq.starterapp; diff --git a/src/main/java/com/kingsrook/qqq/starterapp/StarterAppMetaDataProvider.java b/src/main/java/com/kingsrook/qqq/starterapp/StarterAppMetaDataProvider.java index bd1e89c..31603c3 100644 --- a/src/main/java/com/kingsrook/qqq/starterapp/StarterAppMetaDataProvider.java +++ b/src/main/java/com/kingsrook/qqq/starterapp/StarterAppMetaDataProvider.java @@ -5,18 +5,17 @@ * contact@kingsrook.com * https://github.com/Kingsrook/ * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. + * 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 * - * This program 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 Affero General Public License for more details. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * 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. */ package com.kingsrook.qqq.starterapp; diff --git a/src/test/java/com/kingsrook/qqq/starterapp/StarterAppTest.java b/src/test/java/com/kingsrook/qqq/starterapp/StarterAppTest.java index e5d5ab5..9677558 100644 --- a/src/test/java/com/kingsrook/qqq/starterapp/StarterAppTest.java +++ b/src/test/java/com/kingsrook/qqq/starterapp/StarterAppTest.java @@ -5,18 +5,17 @@ * contact@kingsrook.com * https://github.com/Kingsrook/ * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. + * 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 * - * This program 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 Affero General Public License for more details. + * https://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . + * 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. */ package com.kingsrook.qqq.starterapp;