package com.tech11.spg;

import java.util.Locale;

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

@Mojo(name = "build", requiresProject = false, defaultPhase = LifecyclePhase.PROCESS_SOURCES)
public class SpgMojo extends AbstractMojo {

	/**
	 * Location of the file.
	 */
	//@Parameter(defaultValue = "${project.build.directory}", property = "outputDir", required = true)	
	//private File outputDirectory;

	@Parameter(property = "templateFolder", required = true)
	private String templateFolder;

	@Parameter(property = "targetFolder", required = true)
	private String targetFolder;

	@Parameter(property = "locale", required = true)
	private String localeTxt;

	@Override
	public void execute() throws MojoExecutionException {

		Locale locale = new Locale(localeTxt);

		SystemConfiguration.instance().setTemplateFolder(templateFolder);
		SystemConfiguration.instance().setTargetFolder(targetFolder);
		SystemConfiguration.instance().setLocale(locale);

		new StaticPageGenerator()
				.setTemplateFolder(templateFolder)
				.setTargetFolder(targetFolder)
				.run(); 
		

		// throw new MojoExecutionException("Error creating file " + touch, e);
	}
}

@@ -822,17 +822,23 @@
 erty = %22
-l
+masterL
 ocale%22, 
@@ -870,17 +870,23 @@
  String 
-l
+masterL
 ocaleTxt
@@ -980,25 +980,31 @@
  new Locale(
-l
+masterL
 ocaleTxt);%0A%0A
@@ -1286,24 +1286,55 @@
 rgetFolder)%0A
+%09%09%09%09.setMasterLanguage(locale)%0A
 %09%09%09%09.run(); 

update mvn mojo for property masterLocale