HDDS-11719. Remove dependency on server components from ozonefs-common #7438
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.
What changes were proposed in this pull request?
ozonefs-common
depends on some server-side components withtest
scope, but doesn't actually use any of those. It shouldn't need them, since it's a client-side component.OzoneFsShell
requirescommons-cli
due to the parent class from Hadoop. It gets the dependency accidentally, becauseozone fs
uses theozone-tools
classpath, which has it:ozone/hadoop-ozone/dist/src/shell/ozone/ozone
Lines 191 to 194 in dd22dbe
Similarly,
TestOzoneFsShell
gets the dependency transitively via the server-side components. It started failing after removing the test-scoped dependencies:factory
is initialized inFsShell.init() <- FsShell.run() <- ToolRunner.run()
(which the test calls), but it fails due to classpath issue, and the test suppresses the exception, leavingfactory
as null.Test is updated to let it fail with the original problem, if it happens.
Classpath issue is fixed by removing exclusion of
commons-cli
in client-side dependencies.https://issues.apache.org/jira/browse/HDDS-11719
How was this patch tested?
CI:
https://github.com/adoroszlai/ozone/actions/runs/11859467136