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

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

Introduction

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

Prototype

public void setPackaging(String packaging) 

Source Link

Usage

From source file:pl.project13.maven.git.FileSystemMavenSandbox.java

License:Open Source License

@NotNull
private MavenProject createProject(File basedir, String packaging) {
    MavenProject project = new MavenProject();
    project.setBasedir(basedir);//from w  w w .  j a v  a  2 s  .co m
    project.setPackaging(packaging);
    return project;
}

From source file:se.jguru.nazgul.tools.codestyle.enforcer.rules.MavenTestUtils.java

License:Apache License

/**
 * Creates a MavenProject from the supplied data.
 *
 * @param packaging  The packaging for the MavenProject to return.
 * @param groupId    The groupId for the MavenProject to return.
 * @param artifactId The artifactId for the MavenProject to return.
 * @param version    The version for the MavenProject to return.
 * @return a MavenProjectStub created from the supplied properties.
 *//*from   w  w  w.j  a va2  s  .co m*/
public static MavenProject getStub(final String packaging, final String groupId, final String artifactId,
        final String version) {

    final Model model = new Model();
    model.setModelVersion("4.0.0");
    model.setGroupId(groupId);
    model.setArtifactId(artifactId);
    model.setVersion(version);
    model.setPackaging(packaging);

    // The MavenProjectStub does not query its model for GAV values ...
    final MavenProject toReturn = new MavenProject(model);
    toReturn.setGroupId(groupId);
    toReturn.setArtifactId(artifactId);
    toReturn.setPackaging(packaging);
    toReturn.setVersion(version);
    return toReturn;
}