throw new UnsupportedOperationException("deploy(File, Repository)");
}
@SuppressWarnings("unchecked")
private Repository getRepository(Site site) throws MojoExecutionException, MojoFailureException{
SiteConfig config = site.getConfig();
Object server = config.get("deploy_server");
if(server == null){
throw new MojoFailureException("Deploy server not found in config.yml");
}
String serverId = null;
Map<String,String> repo = null;
if(server instanceof Map){
repo = (Map<String, String>) server;
}else if(server instanceof String){
serverId = (String) server;
repo = (Map<String, String>) config.get(serverId);
if(repo == null){
throw new MojoFailureException("Deploy server not found: " + server);
}
}else{
throw new MojoFailureException("Deploy server not found in config.yml");