예제 #1
0
  @SuppressWarnings("unchecked")
  private Set<Artifact> filtterArtifacts(Set<Artifact> projectArtifacts, FilterArtifacts filter)
      throws MojoExecutionException {
    // perform filtering
    try {
      projectArtifacts = filter.filter(projectArtifacts);
    } catch (ArtifactFilterException e) {
      throw new MojoExecutionException("Error filtering artifacts", e);
    }

    return projectArtifacts;
  }
예제 #2
0
  private FilterArtifacts getFilters(
      String groupId, String artifactId, String type, String classifier) {
    FilterArtifacts filter = new FilterArtifacts();

    if (type != null) {
      filter.addFilter(new TypeFilter(type, null));
    }
    if (classifier != null) {
      filter.addFilter(new ClassifierFilter(classifier, null));
    }
    if (groupId != null) {
      filter.addFilter(new GroupIdFilter(groupId, null));
    }
    if (artifactId != null) {
      filter.addFilter(new ArtifactIdFilter(artifactId, null));
    }

    if (excludeTestDependencies) {
      filter.addFilter(new TestScopeFilter());
    }
    return filter;
  }