use of org.apache.maven.model.Build in project maven-plugins by apache.
the class MavenProjectBasicStub method getBuild.
@Override
public Build getBuild() {
Build build = super.getBuild();
build.setDirectory(System.getProperty("project.build.directory"));
build.setOutputDirectory(System.getProperty("project.build.outputDirectory"));
return build;
}
use of org.apache.maven.model.Build in project maven-plugins by apache.
the class AssemblyMavenProjectStub method getModel.
public Model getModel() {
if (model == null) {
model = new Model();
model.setProperties(new Properties());
model.setGroupId(getGroupId());
model.setArtifactId(getArtifactId());
model.setVersion(getVersion());
Build build = new Build();
build.setFinalName(getArtifactId() + "-" + getVersion());
model.setBuild(build);
}
return model;
}
use of org.apache.maven.model.Build in project maven-plugins by apache.
the class AssemblyInterpolatorTest method testShouldInterpolateMultiDotProjectExpression.
public void testShouldInterpolateMultiDotProjectExpression() throws AssemblyInterpolationException, InvalidAssemblerConfigurationException, AssemblyReadException, IOException {
final Build build = new Build();
build.setFinalName("final-name");
final Model model = new Model();
model.setBuild(build);
final Assembly assembly = new Assembly();
assembly.setId("assembly.${project.build.finalName}");
final PojoConfigSource configSourceStub = new PojoConfigSource();
configSourceStub.setRootInterpolator(FixedStringSearchInterpolator.create());
configSourceStub.setEnvironmentInterpolator(FixedStringSearchInterpolator.create());
final MavenProject project = new MavenProject(model);
configSourceStub.setMavenProject(project);
final Assembly result = roundTripInterpolation(assembly, configSourceStub);
assertEquals("assembly.final-name", result.getId());
}
use of org.apache.maven.model.Build in project maven-plugins by apache.
the class CheckstyleViolationCheckMojoTest method mojoSetup.
protected void mojoSetup(Mojo mojo) throws Exception {
// mojo setup
setVariableValueToObject(mojo, "project", new MavenProjectStub() {
public File getFile() {
return new File(getBasedir(), "target/classes");
}
public Build getBuild() {
return new Build() {
private static final long serialVersionUID = -743084937617131258L;
public String getDirectory() {
return getBasedir() + "/target/classes";
}
};
}
});
setVariableValueToObject(mojo, "configLocation", "sun_checks.xml");
setVariableValueToObject(mojo, "cacheFile", getBasedir() + "/target/classes/checkstyle-cachefile");
// new File( getBasedir() + "/target" ) );
setVariableValueToObject(mojo, "sourceDirectories", Arrays.asList(getBasedir() + "/src/test/plugin-configs/src"));
setVariableValueToObject(mojo, "encoding", "UTF-8");
setVariableValueToObject(mojo, "skipExec", Boolean.TRUE);
}
use of org.apache.maven.model.Build in project maven-plugins by apache.
the class MultiMavenProjectStub method getBuild.
/** {@inheritDoc} */
public Build getBuild() {
Build build = new Build();
build.setDirectory(PlexusTestCase.getBasedir() + "/target/test-harness/checkstyle/multi");
return build;
}
Aggregations