Repository repository = getRepository();
Repository delegate = repository.getFallbackRepository();
if (delegate instanceof MavenDelegateRepository) {
mvnrepo = (MavenDelegateRepository) delegate;
} else if (delegate instanceof RepositoryAggregator) {
RepositoryAggregator aggregator = (RepositoryAggregator) delegate;
for (Repository repo : aggregator.getDelegates()) {
if (repo instanceof MavenDelegateRepository) {
mvnrepo = (MavenDelegateRepository) repo;
break;
}
}