public static Repository toNativeRepository(MavenRemoteRepository r) {
    Repository result = new Repository();
    result.setId(r.getId());
    result.setName(r.getName());
    result.setUrl(r.getUrl());
    result.setLayout(r.getLayout() == null ? "default" : r.getLayout());

    if (r.getReleasesPolicy() != null) result.setReleases(toNativePolicy(r.getReleasesPolicy()));
    if (r.getSnapshotsPolicy() != null) result.setSnapshots(toNativePolicy(r.getSnapshotsPolicy()));

    return result;
  }
public static Repository toNativeRepository(MavenRemoteRepository r)