Exemplo n.º 1
0
  public static ArtifactRepository buildArtifactRepository(org.apache.maven.model.Repository repo)
      throws InvalidRepositoryException {
    if (repo != null) {
      String id = repo.getId();

      if (StringUtils.isEmpty(id)) {
        throw new InvalidRepositoryException("Repository identifier missing", "");
      }

      String url = repo.getUrl();

      if (StringUtils.isEmpty(url)) {
        throw new InvalidRepositoryException("URL missing for repository " + id, id);
      }

      ArtifactRepositoryPolicy snapshots = buildArtifactRepositoryPolicy(repo.getSnapshots());

      ArtifactRepositoryPolicy releases = buildArtifactRepositoryPolicy(repo.getReleases());

      ArtifactRepositoryLayout layout = new DefaultRepositoryLayout();

      return createArtifactRepository(id, url, layout, snapshots, releases);
    } else {
      return null;
    }
  }
Exemplo n.º 2
0
 public List<String> getRepositories() {
   final List<Repository> repos = pom.getRepositories();
   if (repos == null) return null;
   final List<String> repositories = new ArrayList<String>();
   for (Repository repo : repos) repositories.add(repo.getUrl());
   return repositories;
 }
Exemplo n.º 3
0
  public MavenRemoteRepository(Repository repository) {
    myId = repository.getId();
    myName = repository.getName();
    myUrl = repository.getUrl();
    myLayout = repository.getLayout();

    if (repository.getReleases() != null) myReleasesPolicy = new Policy(repository.getReleases());
    if (repository.getSnapshots() != null)
      mySnapshotsPolicy = new Policy(repository.getSnapshots());
  }