codebase cleanupuse resources the maven way,fix some compiler warningsSigned-off-by: Lukas Jungmann <lukas.jungmann@oracle.com> (commit: 955d8f8)