Example usage for org.apache.maven.project MavenProject getContributors

List of usage examples for org.apache.maven.project MavenProject getContributors

Introduction

In this page you can find the example usage for org.apache.maven.project MavenProject getContributors.

Prototype

public List<Contributor> getContributors() 

Source Link

Usage

From source file:com.torchmind.maven.plugins.attribution.AttributionMojo.java

License:Apache License

/**
 * Creates an attribution object using a root artifact and its listed dependencies.
 * @param artifact the maven project./*w w  w.  j av  a  2  s. c  o m*/
 * @param dependencies the dependencies.
 * @return the attribution.
 */
@Nonnull
public static AttributionDocument createAttribution(@Nonnull MavenProject artifact,
        @Nonnull List<Artifact> dependencies, @Nonnull List<Artifact> plugins) {
    return new AttributionDocument(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
            artifact.getName(), artifact.getDescription(), artifact.getUrl(),
            artifact.getLicenses().stream().map(AttributionMojo::createLicense).collect(Collectors.toList()),
            artifact.getDevelopers().stream().map(AttributionMojo::createDeveloper)
                    .collect(Collectors.toList()),
            artifact.getContributors().stream().map(AttributionMojo::createDeveloper)
                    .collect(Collectors.toList()),
            dependencies, plugins);
}

From source file:com.torchmind.maven.plugins.attribution.AttributionMojo.java

License:Apache License

/**
 * Creates an artifact using a maven project.
 * @param artifact the maven project.// w w  w .  ja v  a  2s .  co  m
 * @return the artifact.
 */
@Nonnull
public static Artifact createArtifact(@Nonnull MavenProject artifact) {
    return new Artifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
            artifact.getName(), artifact.getDescription(), artifact.getUrl(),
            artifact.getLicenses().stream().map(AttributionMojo::createLicense).collect(Collectors.toList()),
            artifact.getDevelopers().stream().map(AttributionMojo::createDeveloper)
                    .collect(Collectors.toList()),
            artifact.getContributors().stream().map(AttributionMojo::createDeveloper)
                    .collect(Collectors.toList()));
}

From source file:de.saumya.mojo.gem.GemspecWriter.java

@SuppressWarnings("unchecked")
GemspecWriter(final File gemspec, final MavenProject project, final GemArtifact artifact) throws IOException {
    this.latestModified = project.getFile() == null ? 0 : project.getFile().lastModified();
    this.gemspec = gemspec;
    this.gemspec.getParentFile().mkdirs();
    this.writer = new FileWriter(gemspec);
    this.project = project;

    append("Gem::Specification.new do |s|");
    append("name", artifact.getGemName());
    append("version", gemVersion(project.getVersion()));
    append();//from w  ww . j  a  v  a  2  s.c o  m
    append("summary", project.getName());
    append("description", project.getDescription());
    append("homepage", project.getUrl());
    append();

    for (final Developer developer : (List<Developer>) project.getDevelopers()) {
        appendAuthor(developer.getName(), developer.getEmail());
    }
    for (final Contributor contributor : (List<Contributor>) project.getContributors()) {
        appendAuthor(contributor.getName(), contributor.getEmail());
    }
    append();

    for (final License license : (List<License>) project.getLicenses()) {
        appendLicense(license.getUrl(), license.getName());
    }
}