if (null == targets) {
throw new IllegalStateException("No target to distribute to");
}
targets = new Target[] { targets[0] };
DistributeCommand command = new DistributeCommand(getKernel(), targets, moduleFile, null);
CommandContext commandContext = new CommandContext(true, true, null, null, false);
commandContext.setUsername("system");
commandContext.setPassword("manager");
command.setCommandContext(commandContext);
command.doDeploy(targets[0], true);
} catch (Exception e) {
// Any better ideas?
if(EARConfigBuilder.appInfo.get() == null) throw new RuntimeException(e);