Skip to content

[karaf-4.4.x] fix(ci): make test job depend on build to resolve SNAPSHOT artifacts#2321

Merged
jbonofre merged 1 commit into
apache:karaf-4.4.xfrom
jbonofre:fix/ci-test-dependency-resolution-4.4.x
Mar 14, 2026
Merged

[karaf-4.4.x] fix(ci): make test job depend on build to resolve SNAPSHOT artifacts#2321
jbonofre merged 1 commit into
apache:karaf-4.4.xfrom
jbonofre:fix/ci-test-dependency-resolution-4.4.x

Conversation

@jbonofre
Copy link
Copy Markdown
Member

Summary

Backport of #2320 to karaf-4.4.x.

  • The CI test job uses the -Ptest Maven profile which disables assembly packaging (install-kar, package phases set to none), meaning artifacts like apache-karaf:tar.gz are never built during the test run
  • Previously, build and test ran as independent parallel jobs on separate runners, so the test job could not resolve these SNAPSHOT artifacts from ~/.m2/repository
  • This caused services/interceptor/impl to fail with: Could not find artifact org.apache.karaf:apache-karaf:tar.gz:4.4.10-SNAPSHOT

Fix

  • Add needs: build so the test job runs after build completes
  • Save the Maven local repository from the build job using actions/cache/save with a run-scoped key
  • Restore it in the test job using actions/cache/restore
  • Remove clean from the test Maven command to preserve the restored local repo

Test plan

  • Verify the build job completes and caches ~/.m2/repository
  • Verify the test job restores the cache and resolves apache-karaf:tar.gz successfully
  • Verify test results are still uploaded and published correctly

The test job runs with -Ptest profile which disables assembly packaging
(install-kar, package phases set to none). This means artifacts like
apache-karaf:tar.gz are never built during the test job. Previously,
build and test ran as independent parallel jobs on separate runners,
so the test job could not resolve these SNAPSHOT artifacts.

Fix by:
- Adding needs: build so the test job runs after build completes
- Saving the Maven local repository from build via actions/cache/save
- Restoring it in the test job via actions/cache/restore
- Removing clean from the test Maven command so local repo is preserved
@jbonofre jbonofre merged commit 24933ba into apache:karaf-4.4.x Mar 14, 2026
2 checks passed
@jbonofre jbonofre deleted the fix/ci-test-dependency-resolution-4.4.x branch March 14, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant