Fix maven tests.
(cherry picked from commit 1e4e54d)