From d1421f8f8cfa2fc43158c8a255b1a190acef1e19 Mon Sep 17 00:00:00 2001 From: Shai Almog <67850168+shai-almog@users.noreply.github.com> Date: Wed, 5 Aug 2026 15:31:45 +0700 Subject: [PATCH] Point generated projects at the Codename One R2 repository Phase two of the Maven Central migration. Codename One releases are moving to the repository at https://repo.codenameone.com/maven2, and from August 28 new versions stop being published to Central. A project generated before that date resolves fine today and then silently stops seeing new releases, so the three scaffolding paths now declare the repository up front. Both lists are declared in each root pom. Maven resolves ordinary dependencies through the repositories list and build plugins through the pluginRepositories list, so a project holding only the first downloads codenameone-core and still fails to find a newer codenameone-maven-plugin -- which reads as a corrupt install rather than a missing repository. Snapshots stay disabled on the new repository: it serves releases only, and enabling them would send every local 8.0-SNAPSHOT lookup over the network. The three scaffolds are covered: - cn1app-archetype -- mvn archetype:generate / cn1:generate-app-project - cn1lib-archetype -- library projects, which had no repository block at all - common.zip -- the Initializr root pom (start.codenameone.com) Losing any one of them is invisible at generation time, because Central still serves every already-published version, so validate_generated_repositories.py gates all three in the existing scaffolding-parity workflow, and the initializr matrix test asserts it on the generated root pom. Not included: resolving the archetype ITSELF still goes through Central, so `archetype:generate` will need -DarchetypeRepository (or the R2 archetype-catalog) once Central publication stops. That belongs with the phase-three cutover. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/scaffolding-parity.yml | 15 +- .../resources/archetype-resources/pom.xml | 30 +++- .../resources/archetype-resources/pom.xml | 31 +++++ .../validate_generated_repositories.py | 128 ++++++++++++++++++ .../common/src/main/resources/common.zip | Bin 251279 -> 251573 bytes .../model/GeneratorModelMatrixTest.java | 27 ++++ 6 files changed, 227 insertions(+), 4 deletions(-) create mode 100644 maven/integration-tests/validate_generated_repositories.py diff --git a/.github/workflows/scaffolding-parity.yml b/.github/workflows/scaffolding-parity.yml index 75724c17a1f..8b4240785ba 100644 --- a/.github/workflows/scaffolding-parity.yml +++ b/.github/workflows/scaffolding-parity.yml @@ -9,26 +9,37 @@ name: Scaffolding artifact integrity # android.onDeviceDebug, ...) were added to the archetype but never to the initializr's # common.zip, so they were silently missing from initializr projects. # -# The check only needs python3 + unzip, so it runs fast and is path-gated to the two +# It also guards the Codename One repository declaration in the three generated root +# POMs. Dropping it is invisible at generation time -- Maven Central still serves every +# already-published version -- and only surfaces after the migration cutover, as newly +# generated projects that cannot see new releases. +# +# The check only needs python3 + unzip, so it runs fast and is path-gated to the # templates and the test harness itself. on: pull_request: branches: [ master ] paths: - 'maven/cn1app-archetype/src/main/resources/archetype-resources/common/codenameone_settings.properties' + - 'maven/cn1app-archetype/src/main/resources/archetype-resources/pom.xml' + - 'maven/cn1lib-archetype/src/main/resources/archetype-resources/pom.xml' - 'scripts/initializr/common/src/main/resources/common.zip' - 'maven/integration-tests/scaffolding-settings-parity-test.sh' - 'maven/integration-tests/normalize_cn1_settings.py' - 'maven/integration-tests/validate_initializr_pom_coordinates.py' + - 'maven/integration-tests/validate_generated_repositories.py' - '.github/workflows/scaffolding-parity.yml' push: branches: [ master ] paths: - 'maven/cn1app-archetype/src/main/resources/archetype-resources/common/codenameone_settings.properties' + - 'maven/cn1app-archetype/src/main/resources/archetype-resources/pom.xml' + - 'maven/cn1lib-archetype/src/main/resources/archetype-resources/pom.xml' - 'scripts/initializr/common/src/main/resources/common.zip' - 'maven/integration-tests/scaffolding-settings-parity-test.sh' - 'maven/integration-tests/normalize_cn1_settings.py' - 'maven/integration-tests/validate_initializr_pom_coordinates.py' + - 'maven/integration-tests/validate_generated_repositories.py' - '.github/workflows/scaffolding-parity.yml' concurrency: @@ -43,5 +54,7 @@ jobs: - uses: actions/checkout@v6 - name: Validate Initializr embedded Maven coordinates run: python3 maven/integration-tests/validate_initializr_pom_coordinates.py + - name: Validate Codename One repository is declared by every scaffold + run: python3 maven/integration-tests/validate_generated_repositories.py - name: Compare archetype vs initializr codenameone_settings.properties run: bash maven/integration-tests/scaffolding-settings-parity-test.sh diff --git a/maven/cn1app-archetype/src/main/resources/archetype-resources/pom.xml b/maven/cn1app-archetype/src/main/resources/archetype-resources/pom.xml index dc25455e180..c659deb855e 100644 --- a/maven/cn1app-archetype/src/main/resources/archetype-resources/pom.xml +++ b/maven/cn1app-archetype/src/main/resources/archetype-resources/pom.xml @@ -138,12 +138,36 @@ + - - + + codenameone + https://repo.codenameone.com/maven2 + + true + + + false + + - + + codenameone-plugins + https://repo.codenameone.com/maven2 + + true + + + false + + diff --git a/maven/cn1lib-archetype/src/main/resources/archetype-resources/pom.xml b/maven/cn1lib-archetype/src/main/resources/archetype-resources/pom.xml index 094a899d493..48c8c146d32 100644 --- a/maven/cn1lib-archetype/src/main/resources/archetype-resources/pom.xml +++ b/maven/cn1lib-archetype/src/main/resources/archetype-resources/pom.xml @@ -225,6 +225,37 @@ + + + + codenameone + https://repo.codenameone.com/maven2 + + true + + + false + + + + + + codenameone-plugins + https://repo.codenameone.com/maven2 + + true + + + false + + +