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;
}
Aggregations