marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
try {
generatePackageIndex(directory, packagesXml.getPackage(), directory, packageTypeInfo);
marshaller.marshal(new ObjectFactory().createPackages(packagesXml), writer);
} finally {
writer.close();
}
} catch (Throwable t) {
System.err.println("Failed to generate content index file. Cause: " + t);