@Mojo(name="run", threadSafe=true) @Execute(goal="run") public class GuiceMojo extends org.apache.maven.plugin.AbstractMojo
Create a Guice injector from the configured modules, get a java.lang.Runnable
from the injector, and run it.
If no explicit modules are configured, look for a default module using groupId + artifactId
by converting artifactId
to camel case and appending the word
Module
. For example, the default module that would be loaded using this plugin's GAV information is:
org.kuali.maven.plugins.GuiceMavenPluginModule
Constructor and Description |
---|
GuiceMojo() |
Modifier and Type | Method and Description |
---|---|
protected String |
capitalize(String artifactId) |
void |
execute() |
String |
getAnnotation() |
String |
getModule() |
protected com.google.common.base.Optional<com.google.inject.AbstractModule> |
getModule(GuiceMojo mojo) |
protected com.google.inject.AbstractModule |
getModule(String module) |
List<String> |
getModules() |
org.apache.maven.project.MavenProject |
getProject() |
org.apache.maven.settings.Settings |
getSettings() |
protected <T> T |
newClass(String type) |
protected <T> T |
newInstance(Class<T> type) |
void |
setAnnotation(String annotation) |
void |
setModule(String module) |
void |
setModules(List<String> modules) |
public GuiceMojo()
public void execute()
protected com.google.common.base.Optional<com.google.inject.AbstractModule> getModule(GuiceMojo mojo)
protected String capitalize(String artifactId)
protected <T> T newInstance(Class<T> type)
public org.apache.maven.project.MavenProject getProject()
public org.apache.maven.settings.Settings getSettings()
public void setModules(List<String> modules)
public List<String> getModules()
public String getAnnotation()
public void setAnnotation(String annotation)
Copyright © 2015 The Kuali Foundation. All rights reserved.