You can add an dependency from the client-module to the server-module and set this dependency to provided
(the scope
). Then the server-module should not be part of the client-module.
But I am not sure if this is the maven-way. Sounds a bit like a hack...