// Path: em.common/src/main/java/com/commsen/em/maven/util/Constants.java
// public static final String VAL_EXTENSION_VERSION = getVersion("em");
// 
// Path: em.common/src/main/java/com/commsen/em/maven/util/Templates.java
// @Component(role = Templates.class)
// public class Templates {
// 
// 	private Configuration cfg = new Configuration();
// 	
// 	public Templates() {
// 		cfg.setClassForTemplateLoading(this.getClass(), "/");
// 		cfg.setDefaultEncoding("UTF-8");
// 		cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
// 	}
// 
// 	public Template get (String template) throws IOException {
// 		return cfg.getTemplate(template);
// 	}
// 
// 	public void process (String template, Object dataModel, Writer out) throws IOException, TemplateException {
// 		get(template).process(dataModel, out);
// 	}
// 	
// 	public String process (String template, Object dataModel) throws IOException, TemplateException {
// 		StringWriter out = new StringWriter();
// 		get(template).process(dataModel, out);
// 		return out.toString();
// 	}
// 	
// }


import static com.commsen.em.maven.util.Constants.VAL_EXTENSION_VERSION;
import org.apache.maven.MavenExecutionException;
import org.apache.maven.model.Plugin;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.commsen.em.maven.util.Templates;
package com.commsen.em.maven.plugins;




@Component(role = LinkPlugin.class)
public class LinkPlugin extends DynamicMavenPlugin {

	private Logger logger = LoggerFactory.getLogger(LinkPlugin.class);

	@Requirement
	private Templates templates;
	
	public void addToBuild(MavenProject project) throws MavenExecutionException {

		project.getBuild().getPlugins().add(0, preparePlugin());
		logger.info("Added `em-maven-plugin:link` to keep track of modules");
	}

	private Plugin preparePlugin() throws MavenExecutionException {
		Plugin plugin = createPlugin( //
				"com.commsen.em", //
				"em-maven-plugin", //
				VAL_EXTENSION_VERSION, //
				null, //
// Path: em.common/src/main/java/com/commsen/em/maven/util/Constants.java
// public static final String VAL_EXTENSION_VERSION = getVersion("em");
// 
// Path: em.common/src/main/java/com/commsen/em/maven/util/Templates.java
// @Component(role = Templates.class)
// public class Templates {
// 
// 	private Configuration cfg = new Configuration();
// 	
// 	public Templates() {
// 		cfg.setClassForTemplateLoading(this.getClass(), "/");
// 		cfg.setDefaultEncoding("UTF-8");
// 		cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
// 	}
// 
// 	public Template get (String template) throws IOException {
// 		return cfg.getTemplate(template);
// 	}
// 
// 	public void process (String template, Object dataModel, Writer out) throws IOException, TemplateException {
// 		get(template).process(dataModel, out);
// 	}
// 	
// 	public String process (String template, Object dataModel) throws IOException, TemplateException {
// 		StringWriter out = new StringWriter();
// 		get(template).process(dataModel, out);
// 		return out.toString();
// 	}
// 	
// }


// Path: em-maven-extension/src/main/java/com/commsen/em/maven/plugins/LinkPlugin.java
import static com.commsen.em.maven.util.Constants.VAL_EXTENSION_VERSION;
import org.apache.maven.MavenExecutionException;
import org.apache.maven.model.Plugin;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.commsen.em.maven.util.Templates;

package com.commsen.em.maven.plugins;




@Component(role = LinkPlugin.class)
public class LinkPlugin extends DynamicMavenPlugin {

	private Logger logger = LoggerFactory.getLogger(LinkPlugin.class);

	@Requirement
	private Templates templates;
	
	public void addToBuild(MavenProject project) throws MavenExecutionException {

		project.getBuild().getPlugins().add(0, preparePlugin());
		logger.info("Added `em-maven-plugin:link` to keep track of modules");
	}

	private Plugin preparePlugin() throws MavenExecutionException {
		Plugin plugin = createPlugin( //
				"com.commsen.em", //
				"em-maven-plugin", //
				VAL_EXTENSION_VERSION, //
				null, //
				"link", //