[scala] Self-contained build for scala examples