Description
In gha_build.sh, the archetype function runs mvn -q clean install in the archetype module but doesn't check its exit code. The next step, mvn archetype:generate -DarchetypeCatalog=local, then generates from whatever version of the archetype is in the local catalog.
So when the archetype's integration test fails:
- On a clean machine, which is CI today since setup-java has no Maven cache, nothing is in the local catalog and generate fails with "The desired archetype does not exist". The job goes red, but the error points at the wrong step.
- On a machine that has installed an older archetype before (any dev machine, or CI if Maven caching is turned on later), generate quietly uses the old archetype and the run passes. The new archetype is never tested.
Releases aren't affected: release.yml runs mvn release:prepare/perform over the full reactor, which runs the archetype integration tests and stops on failure.
This came up in #1714. The springboot4 archetype's integration test failed with NoClassDefFoundError for JsonApplyView, and a local gha_build.sh run still reported success because it generated from a cached 3.0.3-SNAPSHOT archetype.
Suggested fix: check the exit code after the archetype install, like the other steps do.
cd ${WORKING_DIR}/${ARCHETYPE_NAME} && mvn -q clean install
if [[ "$?" -ne 0 ]]; then
exit 1
fiPassing -DarchetypeVersion with the project version to archetype:generate would also stop it from falling back to an older archetype.
Activity