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 2a1f888e0d5276545e82fb7c3e3f280422a021d1 Author: Luigi De Masi <[email protected]> AuthorDate: Fri Dec 4 10:38:32 2026 +0100 Fix #125: Publish Maven snapshots to Apache Nexus Use the ASF snapshot repository and deployer credentials for nightly and manual snapshots. Resolve Apache development artifacts while retaining access to legacy Knowledge snapshots. Document encrypted Maven credentials for local staging and test the snapshot repository configuration. Co-authored-by: OpenAI Codex <[email protected]> --- .github/workflows/snapshot.yml | 12 ++++++----- CHANGELOG.md | 1 + distribution.properties | 2 +- docs/modules/ROOT/pages/contributing.adoc | 3 +++ docs/modules/ROOT/pages/getting-started.adoc | 11 ++++++++-- docs/releasing.md | 24 +++++++++++++++++----- docs/security-model.md | 2 +- docs/security-model.yaml | 2 +- kit/README.md | 3 ++- .../camel/kit/config/DistributionConfigTest.java | 13 ++++++------ kit/camel-kit-main/dist/CamelKit.java | 1 - .../src/main/jbang/main/CamelKit.java | 1 - pom.xml | 4 ++-- tools/test_release_target.py | 6 ++++++ 14 files changed, 58 insertions(+), 27 deletions(-) diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index d002acba..6a17a9d2 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -29,9 +29,9 @@ jobs: java-version: '21' distribution: temurin cache: maven - server-id: central - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD + server-id: apache.snapshots.https + server-username-env-var: NEXUS_USER + server-password-env-var: NEXUS_PW - name: Verify the Camel MCP runner before deploying Kit if: github.event_name == 'schedule' || inputs.target == 'all' || inputs.target == 'kit' @@ -40,6 +40,8 @@ jobs: - name: Deploy snapshot run: | set -euo pipefail + : "${NEXUS_USER:?ASF snapshot deployer username is missing}" + : "${NEXUS_PW:?ASF snapshot deployer password is missing}" target_args=() profiles=sourcecheck if [[ "$SNAPSHOT_TARGET" == all || "$SNAPSHOT_TARGET" == kit ]]; then @@ -56,8 +58,8 @@ jobs: ./mvnw -B "${target_args[@]}" -P"$profiles" -Deval.requireVectors=true -DdeployAtEnd=true deploy env: SNAPSHOT_TARGET: ${{ inputs.target || 'all' }} - MAVEN_USERNAME: ${{ secrets.MVN_CENTRAL_USER }} - MAVEN_PASSWORD: ${{ secrets.MVN_CENTRAL_PASSWORD }} + NEXUS_USER: ${{ secrets.NEXUS_USER }} + NEXUS_PW: ${{ secrets.NEXUS_PW }} smoke-install: name: Verify snapshot installation diff --git a/CHANGELOG.md b/CHANGELOG.md index c010cafd..90e83a61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Maven releases now build from the signed RC tag’s source archive. The release manager signs on trusted hardware and stages the source and Apache Nexus repository for a Camel PMC vote before publication (#125). + Nightly Maven snapshots publish to Apache Nexus. The development launcher and Knowledge runner resolve snapshots there. - The development Camel CLI plugin ships its skill catalog, parser providers and runtime dependencies in one JAR for JBang and Camel Launcher. Packaging rejects duplicate pack resources and verifies Mule parsing from the built JAR (#201). diff --git a/distribution.properties b/distribution.properties index 2793e121..26051342 100644 --- a/distribution.properties +++ b/distribution.properties @@ -120,6 +120,6 @@ pi.mcp.adapter.version=2.11.0 # ─── MCP Repos ───────────────────────────────────────────────────────────── camel.mcp.repos=central=https://repo1.maven.org/maven2/,apache=https://repository.apache.org/content/groups/public/,apache_snap=https://repository.apache.org/content/groups/snapshots/,central_snap=https://central.sonatype.com/repository/maven-snapshots/ -knowledge.mcp.repos=central=https://repo1.maven.org/maven2/,central_snap=https://central.sonatype.com/repository/maven-snapshots/ +knowledge.mcp.repos=central=https://repo1.maven.org/maven2/,apache_snap=https://repository.apache.org/snapshots,central_snap=https://central.sonatype.com/repository/maven-snapshots/ citrus.mcp.repos=central=https://repo1.maven.org/maven2/ camel.catalog.repos=https://repo1.maven.org/maven2/,https://repository.apache.org/snapshots diff --git a/docs/modules/ROOT/pages/contributing.adoc b/docs/modules/ROOT/pages/contributing.adoc index d95cd6bd..40cd7429 100644 --- a/docs/modules/ROOT/pages/contributing.adoc +++ b/docs/modules/ROOT/pages/contributing.adoc @@ -445,6 +445,9 @@ the MCP runner with the shipped target profiles. Use the corresponding POM (`pom.xml` with `-N`, `kit/pom.xml`, or `knowledge/pom.xml`) when preparing or staging a release; never deploy the root reactor to release one product. +Nightly builds deploy the parent, Kit and Knowledge to the https://repository.apache.org/snapshots/[Apache snapshot repository]. +A manual `Deploy Snapshot` run can also publish one target. + The final tags are `camel-kit-parent-X.Y.Z`, `camel-kit-X.Y.Z` and `camel-kit-knowledge-X.Y.Z`. Append `-rc1`, `-rc2` and so on for successive signed candidate tags. Dispatch `Verify Maven Release Candidate` from `main` with the target, RC tag and reviewed commit SHA. diff --git a/docs/modules/ROOT/pages/getting-started.adoc b/docs/modules/ROOT/pages/getting-started.adoc index 0c2677d8..9c654f09 100644 --- a/docs/modules/ROOT/pages/getting-started.adoc +++ b/docs/modules/ROOT/pages/getting-started.adoc @@ -158,8 +158,15 @@ camel kit init my-integration --ai claude Development snapshot:: + -- -Apache snapshot artifacts are not yet published. To use the latest development version -`{camel-kit-snapshot-version}`, see the "Build from source" section below. +After the first successful Kit snapshot deployment for `{camel-kit-snapshot-version}`, install it from the +https://repository.apache.org/snapshots/[Apache snapshot repository] with the development alias: + +[source,bash] +---- +jbang app install --force camel-kit@apache/camel-kit +---- + +Until that version is available, use the "Build from source" instructions below. -- Build from source:: diff --git a/docs/releasing.md b/docs/releasing.md index ff068ebd..b9f7e69a 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -124,8 +124,14 @@ The release manager builds and signs both the source and Maven artifacts on trus hardware under their control. Use a personal OpenPGP key whose private material has stayed under the release manager's control. Run staging interactively so the local GnuPG agent can prompt for a passphrase or hardware token. -Configure a Maven server named `apache.releases.https` in your private -`~/.m2/settings.xml` with your Apache committer (LDAP) credentials. The release profile deploys to +Configure the `apache.releases.https` server in `~/.m2/settings.xml` with your Apache +committer ID and encrypted LDAP password. With the Maven 3 wrapper, set up a master +password once using `./mvnw --encrypt-master-password` and store the result in +`~/.m2/settings-security.xml` as described in the [Maven password encryption guide](https://maven.apache.org/guides/mini/guide-encryption.html). +Run `./mvnw --encrypt-password` and paste its output into the server's `<password>` element. +Both commands prompt for the password. Restrict both files to your account (`chmod 600`). + +The release profile deploys to the ASF Nexus staging repository for `org.apache.camel`. See the [ASF Maven publishing instructions](https://infra.apache.org/publishing-maven-artifacts.html), [Camel release guide](https://camel.apache.org/manual/release-guide.html) and @@ -300,13 +306,21 @@ If the vote fails or the candidate changes, announce the outcome, **Drop** its N staging repository and remove the abandoned directory from `dist/dev`. Preserve the old tag. Prepare a new signed RC with the next number, stage it and start a fresh vote. +## Publish Maven snapshots + Before the nightly and manual Kit snapshot deployments, `python3 tools/check_camel_mcp_runner.py` resolves the pinned runner with an empty Maven repository. When the pin is a snapshot and its release JAR appears on Maven Central, the check stops deployment and identifies the version to verify and select. -The nightly snapshot workflow builds the root reactor. Manual snapshot dispatch can -select just the parent, Kit, or Knowledge. Independent product builds require their -chosen shared parent to be available locally or in the configured Maven repository. +The nightly workflow publishes the root reactor to the ASF Nexus snapshot repository. +Manual dispatch can select just the parent, Kit, or Knowledge. The deploy step uses the +ASF snapshot deployer secrets `NEXUS_USER` and `NEXUS_PW` for Maven server +`apache.snapshots.https`. The repository must have access to both secrets before deployment. +For a workstation deployment, configure the same server ID with your encrypted Apache +committer password as described under “Stage the candidate”. Independent product builds +require their chosen shared parent to be available locally or in a configured Maven +repository. Consumers resolve the deployed versions from [Apache snapshots](https://repository.apache.org/snapshots/). +Kit also retains the Sonatype snapshot repository for older `io.github.luigidemasi` Knowledge runners. ## Publish index data diff --git a/docs/security-model.md b/docs/security-model.md index e2c6f748..270e40f6 100644 --- a/docs/security-model.md +++ b/docs/security-model.md @@ -421,7 +421,7 @@ The knobs that move the security envelope: | `camel-kit init --ai <target>` | `bob2` | Selects which **generated harness controls** exist: Claude `settings.json` allow-list (`Read`, `Bash(mvn *)`, `Bash(./mvnw *)`, the manifest-listed `camel`, `camel-knowledge` and `citrus` MCP tools) and a read-only Ship worker (`tools: Read, Grep, Glob`); Codex read-only roles (`sandbox_mode = "read-only"`) and prompt-approved MCP tools; Copilot `preToolUse` deny hook; Pi guard extension and policy; OpenCode three-state permissions; Bob 2 modes [...] | Generated MCP tool lists (`enabled_tools`, `tools`, `directTools`, `includeTools`, `alwaysAllow`/`autoApprove`, OpenCode `permission`) and the Claude `settings.json` MCP rules | the workflow manifest's `allowed_tools` — "the read-only and generation helpers used by the skills", with "runtime mutation/control tools" left out *(documented — `docs/architecture.md` §6)* | **Availability filter** (only the listed tools exist for the agent): Codex `enabled_tools`, Copilot `tools`, Pi `direct [...] | `init --camel-cli=launcher` | Kit-installed Java bootstrap in the trusted workspace | Host executes the bootstrap at MCP startup. The developer reviews it with generated MCP configuration before approving an adopted workspace. Doctor compares its bytes with the installed Kit. Runner downloads use a named HTTPS or local repository and checksum validation. Warm reuse verifies the cached SHA-256 under a per-coordinate/repository lock. | Local users who can edit the approved workspace or t [...] -| `camel.mcp.repos`, `knowledge.mcp.repos`, `citrus.mcp.repos`, `camel.catalog.repos`; JBang launcher `//REPOS` | Maven Central, ASF public, **ASF snapshots, Central snapshots** *(documented — `distribution.properties`, `CamelKit.java`)* | Snapshot repositories serve mutable artifacts: "hosted snapshots are mutable and may lag `main`" *(documented — README)*. `-p` can repoint every list. | **Ruled 2026-10-27 (Q4):** snapshots are retained for development with their mutability documented; [...] +| `camel.mcp.repos`, `knowledge.mcp.repos`, `citrus.mcp.repos`, `camel.catalog.repos`; JBang launcher `//REPOS` | Maven Central, ASF public, **ASF snapshots** for Kit and Knowledge, also Central snapshots for Camel MCP and legacy Knowledge snapshots *(documented — `distribution.properties`, `CamelKit.java`)* | Snapshot repositories serve mutable artifacts: "hosted snapshots are mutable and may lag `main`" *(documented — README)*. `-p` can repoint every list. | **Ruled 2026-10-27 (Q4):** [...] | `camel-kit init --no-fetch` | off | Skips every `init`-time download; the workspace relies on pre-populated `.camel-kit/.cache`. | Documented; no security effect beyond removing network access. | | `camel-kit init --force` | off | Reinitializes an initialized project. Regenerates subagents and personas, updates the marked block in instruction files, and preserves edits and unrecognized shared or catalog content, including a customised Claude `settings.json` allow-list. `--replace <path>` accepts a shared file, a catalog file or the selected assets in a catalog directory *(documented — `docs/commands.md`)*. | Data-loss, not security. A preserved `settings.json` keeps the operator' [...] | `-p key=value`, `-c path` | none | Override any distribution property, including Camel/Quarkus/Spring Boot versions and repository lists. | Trusted input (`OUT-OF-MODEL: trusted-input`). | diff --git a/docs/security-model.yaml b/docs/security-model.yaml index b889adc7..ed2d28ca 100644 --- a/docs/security-model.yaml +++ b/docs/security-model.yaml @@ -228,7 +228,7 @@ configuration_variants: security_relevant: true stance: Trust the generated command and bootstrap together. Doctor compares installed bootstrap bytes to the Kit distribution. - knob: camel.mcp.repos, knowledge.mcp.repos, citrus.mcp.repos, camel.catalog.repos, JBang //REPOS - default: Maven Central, ASF public, ASF snapshots, Central snapshots + default: Maven Central, ASF public, ASF snapshots for Kit and Knowledge, also Central snapshots for Camel MCP and legacy Knowledge snapshots effect: Snapshot repositories serve mutable artifacts. Kit release validation requires a release version for camel.mcp.version. security_relevant: true stance: ruled 2026-10-27 - snapshots retained for development with their mutability documented; release defaults pin released versions; snapshot mutability waives no other control diff --git a/kit/README.md b/kit/README.md index 2cd7baf4..7d692895 100644 --- a/kit/README.md +++ b/kit/README.md @@ -150,7 +150,8 @@ commit or back up customized generated files, then run `camel-kit init --here -- jbang app install --force camel-kit@apache/camel-kit ``` -This installs the latest deployed `0.4.2-SNAPSHOT`. Build from source for a specific revision. +After the first deployment of `0.4.2-SNAPSHOT`, this resolves it from the [Apache snapshot repository](https://repository.apache.org/snapshots/). +Build from source for a specific revision or before the snapshot is available. In current source builds, `init` configures Camel and Knowledge MCP by default; add `--with-citrus-mcp` to include Citrus MCP. Release `0.4.1` included all three by diff --git a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/config/DistributionConfigTest.java b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/config/DistributionConfigTest.java index 5ad30b99..3e0b7797 100644 --- a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/config/DistributionConfigTest.java +++ b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/config/DistributionConfigTest.java @@ -357,13 +357,12 @@ class DistributionConfigTest { } @Test - void snapshotKnowledgeMcpUsesSnapshotRepository() { - DistributionConfig config = DistributionConfig.loadBundled(); - assertTrue( - !config.knowledgeMcpVersion().endsWith("-SNAPSHOT") - || config.knowledgeMcpRepos().contains( - "central_snap=https://central.sonatype.com/repository/maven-snapshots/"), - "SNAPSHOT Knowledge MCP versions require the Central Portal snapshots repository"); + void bundledRepositoriesResolveReleasedAndSnapshotKnowledgeRunners() { + assertEquals( + List.of("central=https://repo1.maven.org/maven2/", + "apache_snap=https://repository.apache.org/snapshots", + "central_snap=https://central.sonatype.com/repository/maven-snapshots/"), + List.of(DistributionConfig.loadBundled().knowledgeMcpRepos().split(","))); } private static Properties bundledProperties() throws java.io.IOException { diff --git a/kit/camel-kit-main/dist/CamelKit.java b/kit/camel-kit-main/dist/CamelKit.java index 2691f336..3f34ad1a 100755 --- a/kit/camel-kit-main/dist/CamelKit.java +++ b/kit/camel-kit-main/dist/CamelKit.java @@ -4,7 +4,6 @@ //JAVA_OPTIONS --enable-native-access=ALL-UNNAMED //REPOS central=https://repo1.maven.org/maven2/,apache_snap=https://repository.apache.org/snapshots -//REPOS central_snap=https://central.sonatype.com/repository/maven-snapshots/ //DEPS org.apache.camel:camel-kit-core:${camel.kit.version:0.4.2-SNAPSHOT} package main; diff --git a/kit/camel-kit-main/src/main/jbang/main/CamelKit.java b/kit/camel-kit-main/src/main/jbang/main/CamelKit.java index 2691f336..3f34ad1a 100644 --- a/kit/camel-kit-main/src/main/jbang/main/CamelKit.java +++ b/kit/camel-kit-main/src/main/jbang/main/CamelKit.java @@ -4,7 +4,6 @@ //JAVA_OPTIONS --enable-native-access=ALL-UNNAMED //REPOS central=https://repo1.maven.org/maven2/,apache_snap=https://repository.apache.org/snapshots -//REPOS central_snap=https://central.sonatype.com/repository/maven-snapshots/ //DEPS org.apache.camel:camel-kit-core:${camel.kit.version:0.4.2-SNAPSHOT} package main; diff --git a/pom.xml b/pom.xml index efe53943..1c5bc2d4 100644 --- a/pom.xml +++ b/pom.xml @@ -57,8 +57,8 @@ </issueManagement> <distributionManagement> <snapshotRepository> - <id>central</id> - <url>https://central.sonatype.com/repository/maven-snapshots/</url> + <id>apache.snapshots.https</id> + <url>https://repository.apache.org/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement> <repositories> diff --git a/tools/test_release_target.py b/tools/test_release_target.py index 569352d4..f3f10b2b 100644 --- a/tools/test_release_target.py +++ b/tools/test_release_target.py @@ -156,6 +156,12 @@ class ReleaseTargetTest(unittest.TestCase): self.assertNotEqual(0, result.returncode) self.assertEqual(b"", result.stdout) + def test_snapshots_deploy_to_apache(self): + pom = ET.parse(REPOSITORY / "pom.xml") + repository = pom.find("{*}distributionManagement/{*}snapshotRepository") + self.assertEqual("apache.snapshots.https", repository.findtext("{*}id")) + self.assertEqual("https://repository.apache.org/content/repositories/snapshots", repository.findtext("{*}url")) + def test_release_deploys_to_apache_staging(self): pom = ET.parse(REPOSITORY / "pom.xml") release = pom.find(".//{*}profile[{*}id='release']")
