config.setUsername(username);
config.setPassword(password);
config.setContext(portalContextPath);
config.setPortletApplicationContext(portletApplicationContext);
PortletPublishService publisher =
PortletPublishServiceFactory.getFactory().createPortletPublishService(config);
try {
publisher.publish(config);
}
catch(UtilityException ue) {
throw new MojoExecutionException(ue.getMessage());
}
}