use of org.apache.maven.execution.MavenExecutionRequest in project tycho by eclipse.
the class ValidateIdTest method getMojo.
private ValidateIdMojo getMojo(File basedir) throws Exception {
File pom = new File(basedir, "pom.xml");
MavenExecutionRequest request = newMavenExecutionRequest(pom);
request.getProjectBuildingRequest().setProcessPlugins(false);
MavenExecutionResult result = maven.execute(request);
MavenProject project = result.getProject();
ValidateIdMojo mojo = (ValidateIdMojo) lookupMojo("validate-id", project.getFile());
setVariableValueToObject(mojo, "project", project);
setVariableValueToObject(mojo, "packaging", project.getPackaging());
return mojo;
}
Aggregations