package com.github.visitorj;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

/**
 * This goal will say a message.
 */
@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true)
public class CodeGeneratorMojo extends AbstractMojo {
	@Parameter(property = "packageName", defaultValue = "")
	private String packageName;

	@Override
	public void execute() throws MojoExecutionException, MojoFailureException {
		getLog().info("hi there");
	}
}
@@ -25,16 +25,157 @@
 orj;%0D%0A%0D%0A
+import java.io.File;%0D%0Aimport java.io.IOException;%0D%0Aimport java.util.EnumSet;%0D%0Aimport java.util.List;%0D%0Aimport java.util.stream.Collectors;%0D%0A%0D%0A
 import o
@@ -208,24 +208,24 @@
 tractMojo;%0D%0A
-
 import org.a
@@ -492,16 +492,177 @@
 ter;%0D%0A%0D%0A
+import com.github.visitorj.codegen.GeneratorType;%0D%0Aimport com.github.visitorj.codegen.JavaClass;%0D%0Aimport com.github.visitorj.codegen.VisitorGeneratorService;%0D%0A%0D%0A
 /**%0D%0A * 
@@ -845,16 +845,252 @@
 Mojo %7B%0D%0A
+%09@Parameter(property = %22visitorName%22, defaultValue = %22Visitor%22)%0D%0A%09private String visitorName;%0D%0A%0D%0A%09@Parameter(property = %22outputDirectory%22, defaultValue = %22$%7Bproject.build.directory%7D/generated/java%22)%0D%0A%09private String outputDirectory;%0D%0A%0D%0A
 %09@Parame
@@ -1171,16 +1171,85 @@
 ame;%0D%0A%0D%0A
+%09@Parameter(property = %22classes%22)%0D%0A%09private List%3CString%3E classes;%0D%0A%0D%0A
 %09@Overri
@@ -1351,19 +1351,472 @@
 fo(%22
-hi there%22);
+Generating sources for visitor %22 + visitorName);%0D%0A%09%09final VisitorGeneratorService service = new VisitorGeneratorService();%0D%0A%09%09final List%3CJavaClass%3E javaClasses = classes.stream().map(JavaClass::new).collect(Collectors.toList());%0D%0A%09%09try %7B%0D%0A%09%09%09service.generate(visitorName, new File(outputDirectory), javaClasses, packageName,%0D%0A%09%09%09%09%09EnumSet.allOf(GeneratorType.class));%0D%0A%09%09%7D catch (final IOException e) %7B%0D%0A%09%09%09throw new MojoExecutionException(e.getMessage(), e);%0D%0A%09%09%7D
 %0D%0A%09%7D

add plugin parameters