Search in sources :

Example 1 with ResourcesMojo

use of org.apache.maven.plugins.resources.ResourcesMojo in project maven-plugins by apache.

the class CopyResourcesMojoTest method testCopyWithoutFiltering.

public void testCopyWithoutFiltering() throws Exception {
    File testPom = new File(getBasedir(), defaultPomFilePath);
    ResourcesMojo mojo = (ResourcesMojo) lookupMojo("resources", testPom);
    mojo.setOutputDirectory(outputDirectory);
    Resource resource = new Resource();
    resource.setDirectory(getBasedir() + "/src/test/unit-files/copy-resources-test/no-filter");
    resource.setFiltering(false);
    mojo.setResources(Collections.singletonList(resource));
    MavenProjectResourcesStub project = new MavenProjectResourcesStub("CopyResourcesMojoTest");
    File targetFile = new File(getBasedir(), "/target/copyResourcesTests");
    project.setBaseDir(targetFile);
    setVariableValueToObject(mojo, "project", project);
    mojo.execute();
    assertTrue(new File(targetFile, "config.properties").exists());
}
Also used : MavenProjectResourcesStub(org.apache.maven.plugins.resources.stub.MavenProjectResourcesStub) ResourcesMojo(org.apache.maven.plugins.resources.ResourcesMojo) Resource(org.apache.maven.model.Resource) File(java.io.File)

Aggregations

File (java.io.File)1 Resource (org.apache.maven.model.Resource)1 ResourcesMojo (org.apache.maven.plugins.resources.ResourcesMojo)1 MavenProjectResourcesStub (org.apache.maven.plugins.resources.stub.MavenProjectResourcesStub)1