Repository navigation
Conversation
…oals The offline key of the assembly resolver missed its dot since KARAF-3968, and the verify goal never passed maven.offline to its resolver. Fixes apache#3151 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3151.
The
assemblyandverifygoals now pass Maven offline mode (mvn -o) to their Maven resolver. @jbonofre asked to split this out of #2979 in its review.Changes
Builder: the offline key is nowpid + ".offline"(the dot was missing). The configuration moved tomavenResolverConfiguration(pid), so a test can check it.VerifyMojo: putsmaven.offline=truein the resolver configuration when Maven runs offline. The configuration moved to the staticresolverConfiguration(...)for the same reason.Behaviour change
Until now, the resolver of both goals stayed online under
-o. Now:_remote.repositoriessaysnexus, the resolver usescentral) fails with "Cannot access central ... in offline mode and the artifact has not been downloaded from it before".Release note: The karaf-maven-plugin
assemblyandverifygoals now honour Maven offline mode (-o). Offline builds that relied on the plugin downloading missing artifacts must run online once first.Tests
BuilderTest#testMavenResolverConfigurationandVerifyMojoTest#testResolverConfigurationcheck the offline key.New invoker IT
test-assembly-offlineruns three builds:clean packageonline, which fills the local repository;-o -Pmissing-bundle package, which adds a bundle that is not in the local repository: the build must fail.verify.bshchecks that the bundle was not downloaded and thatbuild.loghas an offline-mode error for it;-o clean package: the offline assembly must succeed.It uses the released
framework4.4.11 KAR, because the SNAPSHOT KAR of this build is only built after the plugin. That is also why the existing assembly ITs are excluded.The IT is excluded from the
test-offlineinvoker execution, because that execution replaces itsinvoker.properties(so it would only run a plainpackage).The
verifygoal has no offline IT:VerifyMojoTestonly checks the configuration it passes to the resolver.Results:
pid + "offline"key back inBuilder. Then the IT fails at step 2: the-obuild succeeds and downloadscommons-csv-1.12.0.jar.Backport
The missing dot dates from KARAF-3968 (Karaf 4.0.2), so
karaf-4.4.xhas the same bug (there the key isORG_OPS4J_PAX_URL_MVN_PID + "offline"). I can open a backport PR if you want the fix there too.🤖 Generated with Claude Code