Project project = ProjectBuilder.builder().build();
project.getPlugins().apply(WarPlugin.class);
project.getPlugins().apply(RebelPlugin.class);
// Configure the rebel plugin
RebelDslMain rebelExtension = (RebelDslMain) project.getExtensions().getByName(RebelPlugin.REBEL_EXTENSION_NAME);
RebelDslWeb web = new RebelDslWeb();
RebelDslWebResource webResource1 = new RebelDslWebResource();
webResource1.setTarget("/");
webResource1.setDirectory("src/main/webapp");
webResource1.setIncludes(Arrays.<String>asList("*.xml"));
webResource1.setExcludes(Arrays.<String>asList("*.java", "*.groovy", "*.scala"));
web.addWebResources(webResource1);
RebelDslWebResource webResource2 = new RebelDslWebResource();
webResource2.setTarget("/WEB-INF/");
webResource2.setDirectory("src/main/my-web-inf");
web.addWebResources(webResource2);
log.info("RebelDslWeb : " + web);
rebelExtension.setWeb(web);
callAfterEvaluated(project);
// Execute the rebel task, validate the generated model
RebelGenerateTask task = (RebelGenerateTask) project.getTasks().getByName(RebelPlugin.GENERATE_REBEL_TASK_NAME);