public void execute() throws BuildException {
validateArgs();
try {
PortletPublishConfig config = new PortletPublishConfig();
config.setHost(getHost());
config.setPort(getPort());
config.setContext(getPortalContext());
config.setUsername(getUsername());
config.setPassword(getPassword());
config.setPortletApplicationContext(getPortletApplicationContext());
PortletPublishService publisher = PortletPublishServiceFactory.getFactory()
.createPortletPublishService(config);
publisher.publish(config);
}