Fixing error with brpJavaRepack setting and add regression test