}
public void execute(Log log) throws MojoExecutionException
{
JetspeedPageSerializerApplication app = null;
try
{
Class dfClass = Class.forName(PAGE_SERIALIZER_APPLICATION_CLASS_NAME, true, Thread.currentThread().getContextClassLoader());
app = (JetspeedPageSerializerApplication) dfClass.newInstance();
}
catch (Exception e)
{
throw new MojoExecutionException("Cannot find or load JetspeedPageSerializerApplication class "+ PAGE_SERIALIZER_APPLICATION_CLASS_NAME, e);
}
ToolsLogger logger = new MavenToolsLogger(log);
Properties props = new Properties();
if (initProperties != null)
{
// working around an odd Maven on MacOS issue which stored empty mapped properties actually as null values,
// which isn't allowed for properties
Iterator iter = initProperties.entrySet().iterator();
while (iter.hasNext())
{
Map.Entry entry = (Map.Entry)iter.next();
if (entry.getValue() == null)
{
entry.setValue("");
}
}
props.putAll(initProperties);
}
if (psmlPagesPath != null)
{
props.put("psml.pages.path", psmlPagesPath);
}
try
{
if (importing)
{
app.importPages(logger, applicationRootPath, categories, filterPropertiesFileName, props, rootFolder);
}
else
{
app.exportPages(logger, applicationRootPath, categories, filterPropertiesFileName, props, rootFolder);
}
}
catch (JetspeedException je)
{
throw new MojoExecutionException("PageSerializer error: ",je);