Search in sources :

Example 6 with Build

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;
}
Also used : Build(org.apache.maven.model.Build)

Example 7 with 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;
}
Also used : Build(org.apache.maven.model.Build) Model(org.apache.maven.model.Model) Properties(java.util.Properties)

Example 8 with Build

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());
}
Also used : MavenProject(org.apache.maven.project.MavenProject) Build(org.apache.maven.model.Build) Model(org.apache.maven.model.Model) PojoConfigSource(org.apache.maven.plugins.assembly.testutils.PojoConfigSource) Assembly(org.apache.maven.plugins.assembly.model.Assembly)

Example 9 with Build

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);
}
Also used : MavenProjectStub(org.apache.maven.plugin.testing.stubs.MavenProjectStub) Build(org.apache.maven.model.Build) File(java.io.File)

Example 10 with Build

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;
}
Also used : Build(org.apache.maven.model.Build)

Aggregations

Build (org.apache.maven.model.Build)23 Model (org.apache.maven.model.Model)7 MavenProject (org.apache.maven.project.MavenProject)7 File (java.io.File)4 MavenBuild (org.eclipse.che.maven.data.MavenBuild)4 Properties (java.util.Properties)3 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 Parent (org.apache.maven.model.Parent)2 Plugin (org.apache.maven.model.Plugin)2 PluginManagement (org.apache.maven.model.PluginManagement)2 Profile (org.apache.maven.model.Profile)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 Path (java.nio.file.Path)1 List (java.util.List)1 Map (java.util.Map)1 JarFile (java.util.jar.JarFile)1 DefaultArtifact (org.apache.maven.artifact.DefaultArtifact)1 DependencyResolutionRequiredException (org.apache.maven.artifact.DependencyResolutionRequiredException)1 ArtifactHandler (org.apache.maven.artifact.handler.ArtifactHandler)1