adoroszlai opened a new pull request, #7438: URL: https://github.com/apache/ozone/pull/7438
## What changes were proposed in this pull request? `ozonefs-common` depends on some server-side components with `test` scope, but doesn't actually use any of those. It shouldn't need them, since it's a client-side component. `OzoneFsShell` requires `commons-cli` due to the parent class from Hadoop. It gets the dependency accidentally, because `ozone fs` uses the `ozone-tools` classpath, which has it: https://github.com/apache/ozone/blob/dd22dbef8958311c2ec5e99822269405d59f8eba/hadoop-ozone/dist/src/shell/ozone/ozone#L191-L194 Similarly, `TestOzoneFsShell` gets the dependency transitively via the server-side components. It started failing after removing the test-scoped dependencies: ``` Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.153 s <<< FAILURE! - in org.apache.hadoop.fs.ozone.TestOzoneFsShell org.apache.hadoop.fs.ozone.TestOzoneFsShell.testOzoneFsShellRegisterDeleteCmd Time elapsed: 0.132 s <<< ERROR! java.lang.NullPointerException: Cannot invoke "org.apache.hadoop.fs.shell.CommandFactory.getNames()" because "factory" is null at org.apache.hadoop.fs.ozone.TestOzoneFsShell.testOzoneFsShellRegisterDeleteCmd(TestOzoneFsShell.java:59) ``` `factory` is initialized in `FsShell.init() <- FsShell.run() <- ToolRunner.run()` (which the test calls), but it fails due to classpath issue, and the test suppresses the exception, leaving `factory` 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 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
