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

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

Introduction

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

Prototype

public String getDefaultGoal() 

Source Link

Usage

From source file:hudson.gridmaven.PomInfo.java

License:Open Source License

public PomInfo(MavenProject project, PomInfo parent, String relPath) {
    this.name = new ModuleName(project);
    this.version = project.getVersion();
    this.displayName = project.getName();
    this.defaultGoal = project.getDefaultGoal();
    this.relativePath = relPath;
    this.parent = parent;
    if (parent != null)
        parent.children.add(name);/* www . ja v  a  2 s. c om*/

    for (Dependency dep : (List<Dependency>) project.getDependencies())
        dependencies.add(new ModuleDependency(dep));

    MavenProject parentProject = project.getParent();
    if (parentProject != null)
        dependencies.add(new ModuleDependency(parentProject));
    if (parent != null)
        dependencies.add(parent.asDependency());

    addPluginsAsDependencies(project.getBuildPlugins(), dependencies);
    addReportPluginsAsDependencies(project.getReportPlugins(), dependencies);

    List<Extension> extensions = project.getBuildExtensions();
    if (extensions != null)
        for (Extension ext : extensions)
            dependencies.add(new ModuleDependency(ext));

    // when the parent POM uses a plugin and builds a plugin at the same time,
    // the plugin module ends up depending on itself
    dependencies.remove(asDependency());

    CiManagement ciMgmt = project.getCiManagement();
    if ((ciMgmt != null) && (ciMgmt.getSystem() == null || ciMgmt.getSystem().equals("hudson"))) {
        Notifier mailNotifier = null;
        for (Notifier n : (List<Notifier>) ciMgmt.getNotifiers()) {
            if (n.getType().equals("mail")) {
                mailNotifier = n;
                break;
            }
        }
        this.mailNotifier = mailNotifier;
    } else
        this.mailNotifier = null;

    this.groupId = project.getGroupId();
    this.artifactId = project.getArtifactId();
    this.packaging = project.getPackaging();
}