Search in sources :

Example 1 with MavenZipProject

use of org.apache.maven.plugins.war.stub.MavenZipProject in project maven-plugins by apache.

the class WarZipTest method configureMojo.

private File configureMojo(String testId) throws Exception {
    MavenZipProject project = new MavenZipProject();
    String outputDir = getTestDirectory().getAbsolutePath() + File.separatorChar + testId + "-output";
    // clean up
    File outputDirFile = new File(outputDir);
    if (outputDirFile.exists()) {
        FileUtils.deleteDirectory(outputDirFile);
    }
    File webAppDirectory = new File(getTestDirectory(), testId);
    WarArtifactStub warArtifact = new WarArtifactStub(getBasedir());
    String warName = "simple";
    File webAppSource = createWebAppSource(testId);
    File classesDir = createClassesDir(testId, true);
    File xmlSource = createXMLConfigDir(testId, new String[] { "web.xml" });
    project.setArtifact(warArtifact);
    this.configureMojo(mojo, new LinkedList<String>(), classesDir, webAppSource, webAppDirectory, project);
    setVariableValueToObject(mojo, "outputDirectory", outputDir);
    setVariableValueToObject(mojo, "warName", warName);
    setVariableValueToObject(mojo, "workDirectory", new File(getTestDirectory(), "work"));
    mojo.setWebXml(new File(xmlSource, "web.xml"));
    project.getArtifacts().add(buildZipArtifact());
    return webAppDirectory;
}
Also used : WarArtifactStub(org.apache.maven.plugins.war.stub.WarArtifactStub) MavenZipProject(org.apache.maven.plugins.war.stub.MavenZipProject) File(java.io.File)

Aggregations

File (java.io.File)1 MavenZipProject (org.apache.maven.plugins.war.stub.MavenZipProject)1 WarArtifactStub (org.apache.maven.plugins.war.stub.WarArtifactStub)1