org.apache.maven.artifact.Artifact artifact = project.getArtifact();
artifact.setFile(targetFile);
try {
//now pack up the server.
ServerInfo serverInfo = new BasicServerInfo(targetServerDirectory.getAbsolutePath(), false);
ArchiverGBean archiver = new ArchiverGBean(serverInfo);
if (excludes != null) {
for (String exclude : excludes) {
archiver.addExclude(exclude);
}
}
archive("tar.gz", archiver);
archive("zip", archiver);
} catch (Exception e) {