Plugin plugin = descriptorProcessor.getPlugin();
File confluencePluginOutputFile = generateConfluencePluginPage(resourceTypes, confluenceOutputDir, plugin);
generateConfluenceResourceTypePages(null, resourceTypes, confluenceOutputDir, plugin);
boolean publishConfluencePages = (this.confluenceUserName != null) && (this.confluencePassword != null);
Confluence confluence;
if (publishConfluencePages) {
String endpointURL = this.confluenceUrl + "/rpc/xmlrpc";
log.debug("Publishing plugin docs to Confluence endpoint [" + endpointURL + "]...");
try {
confluence = createConfluenceEndpoint(endpointURL);
} catch (Exception e) {
throw new RuntimeException("Failed to connect to Confluence endpoint [" + endpointURL + "].", e);
}
try {
Page basePage = publishConfluenceBasePage(confluence);
//removeDescendantPages(confluence, basePage);
publishPluginPage(plugin, confluencePluginOutputFile, confluence, basePage);
publishConfluenceResourceTypePages(null, resourceTypes, plugin, confluenceOutputDir, confluence);
} catch (Exception e) {
throw new RuntimeException("Failed to publish plugin docs to Confluence endpoint [" + endpointURL
+ "].", e);
} finally {
try {
confluence.logout();
} catch (SwizzleException e) {
log.error("Failed to logout from Confluence endpoint.", e);
}
}
}