|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.grails.cli.api.BaseSettingsApi
org.codehaus.groovy.grails.cli.maven.MavenPomGenerator
class MavenPomGenerator extends BaseSettingsApi
Generates a POM for a Grails application.
Field Summary |
---|
Fields inherited from class BaseSettingsApi | |
---|---|
appClassName, buildEventListener, buildProps, buildSettings, configSlurper, enableProfile, grailsAppName, grailsHome, isInteractive, metadata, metadataFile, pluginSettings, pluginsHome, resolver |
Constructor Summary | |
MavenPomGenerator(BuildSettings buildSettings)
|
Method Summary | |
---|---|
protected java.util.Map
|
createModel(java.lang.String group, java.io.File projDir)
Creates a standard template model based on the target directory containing a Grails project. |
protected java.util.Map
|
createModel(java.lang.String group, Metadata projInfo, GrailsPluginInfo pluginInfo = null)
|
void
|
generate(java.lang.String group)
Creates a pom.xml file for the current Grails project, i.e. the one pointed to by the build's base directory. |
DependencyInfo
|
generate(java.lang.String group, java.io.File projDir, java.util.Map addedModel)
Creates a pom.xml file for the Grails project in the given directory. |
void
|
generatePom(java.io.File projDir, java.lang.String templatePath, java.util.Map model)
Creates a pom.xml file in the target directory using the template located at the given path combined with the given model. |
void
|
generateWithParent(java.lang.String group)
This does the same as generate(java.lang.String), but the generated POM includes a parent element containing the details of whatever POM is found in the current project's parent directory. |
protected java.util.List
|
getDependenciesForScope(DependencyManager dependencyManager, java.lang.String scope, java.lang.String type = "", java.lang.String newScope = null)
Returns a list of plugin or application dependencies stored in the given dependency manager. |
protected java.util.Map
|
getParentModel(java.io.File pomFile)
|
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Constructor Detail |
---|
MavenPomGenerator(BuildSettings buildSettings)
Method Detail |
---|
protected java.util.Map createModel(java.lang.String group, java.io.File projDir)
group
- This is used to populate the model with the variable used for
the POM's groupId element.projDir
- The directory containing the Grails project of interest.
protected java.util.Map createModel(java.lang.String group, Metadata projInfo, GrailsPluginInfo pluginInfo = null)
void generate(java.lang.String group)
group
- The string to use for the POM's groupId element.
DependencyInfo generate(java.lang.String group, java.io.File projDir, java.util.Map addedModel)
group
- The string to use for the POM's groupId element.projDir
- The directory containing the Grails project you want to
create a POM for. It must exist!addedModel
- A map of additional values for the template. Supported
variables are:
void generatePom(java.io.File projDir, java.lang.String templatePath, java.util.Map model)
projDir
- The target directory to put the POM.templatePath
- A relative Grails resource path to the template file to
use. The template must conform to Groovy's SimpleTemplateEngine
syntax.model
- A map of variables and values that will be substituted into the
template.
void generateWithParent(java.lang.String group)
group
- The string to use for the POM's groupId element.
protected java.util.List getDependenciesForScope(DependencyManager dependencyManager, java.lang.String scope, java.lang.String type = "", java.lang.String newScope = null)
scope
- The dependency scope you're interested in, e.g. 'compile',
'provided', etc.type
- The type of the dependencies you want. This can by null
or an empty string, both of which imply you want just JAR dependencies. Any
other type is assumed to mean you want the plugin dependencies. The returned
DependencyInfo instances will use the type you specify here.newScope
- If specified, the returned DependencyInfo instances
will use this for the scope property. Otherwise, they will use the
value from the scope argument.
protected java.util.Map getParentModel(java.io.File pomFile)
Groovy Documentation