Generates a POM for a Grails application.
Fields inherited from class | Fields |
---|---|
class BaseSettingsApi |
appClassName, buildEventListener, buildProps, buildSettings, configSlurper, enableProfile, grailsAppName, grailsHome, isInteractive, metadata, metadataFile, pluginSettings, pluginsHome, resolver |
Constructor and description |
---|
MavenPomGenerator
(BuildSettings buildSettings) |
Type | Name and description |
---|---|
protected java.util.List<DependencyInfo> |
convertExclusionsToRealDeps(Dependency dependency) Converts the exclusions of a dependency into real, resolved dependencies. |
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<DependencyInfo> |
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) |
Converts the exclusions of a dependency into real, resolved dependencies. This is to account for the fact that Ivy allows for exclusions based on group or name alone. Maven requires both the group and name for exclusion. Therefore, this method resolves the current dependency and looks for matching transitive dependencies that are to be excluded from the current dependency in the generated POM file.
dependency
- The current dependency that may have exclusions.Creates a standard template model based on the target directory containing a Grails project. The method will pick out the project's name, version, and dependencies from the appropriate files. It works for both application and plugin projects.
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.Creates a pom.xml file for the current Grails project, i.e. the one pointed to by the build's base directory. The generated POM will include the JAR and plugin dependencies declared in BuildConfig.groovy.
group
- The string to use for the POM's groupId element.Creates a pom.xml file for the Grails project in the given directory. It not only allows you to provide a value for the groupId, but you can also provide additional values for the POM template.
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:
Creates a pom.xml file in the target directory using the template located at the given path combined with the given model. The template path is resolved as a Grails resource (which may be in the grails-resources JAR or in $GRAILS_HOME on the filesystem).
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.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. The current project is defined as the one in the build's base directory.
group
- The string to use for the POM's groupId element.Returns a list of plugin or application dependencies stored in the given dependency manager.
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.