Package: org.codehaus.groovy.grails.project.packaging

## [Groovy] Class GrailsProjectPackager

- org.codehaus.groovy.grails.project.packaging.GrailsProjectPackager

- Encapsulates the logic to package a project ready for execution.

  Authors:
    Graeme Rocher
  Since:
    2.0

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static java.lang.String` | `LOGGING_INITIALIZER_CLASS` |
    `protected groovy.util.AntBuilder` | `ant` |
    `protected java.io.File` | `basedir` |
    `protected groovy.util.ConfigObject` | `config` |
    `protected boolean` | `doCompile` |
    `protected boolean` | `packaged` |
    `protected java.lang.Object` | `resourcesDirPath` |
    `protected java.lang.String` | `serverContextPath` |
    `protected java.io.File` | `webXmlFile` |
    `protected boolean` | `webXmlGenerated` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class BaseSettingsApi` | `appClassName, buildEventListener, buildProps, buildSettings, configSlurper, enableProfile, grailsAppName, grailsHome, isInteractive, metadata, metadataFile, pluginSettings, pluginsHome, resolver`

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `boolean` | `async`
    `java.lang.ClassLoader` | `classLoader`
    `java.io.File` | `configFile`
    `GrailsConsole` | `grailsConsole`
    `boolean` | `native2ascii`
    `GrailsProjectCompiler` | `projectCompiler`
    `java.lang.String` | `servletVersion`
    `boolean` | `warMode`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GrailsProjectPackager (GrailsProjectCompiler compiler, boolean doCompile = true)`
    `GrailsProjectPackager (GrailsProjectCompiler compiler, java.io.File configFile, boolean doCompile = true)`
    `GrailsProjectPackager (GrailsProjectCompiler compiler, GrailsBuildEventListener buildEventListener, boolean doCompile = true)`
    `GrailsProjectPackager (GrailsProjectCompiler compiler, GrailsBuildEventListener buildEventListener, java.io.File configFile, boolean doCompile = true)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `java.lang.String` | `configureServerContextPath()`
    `groovy.util.ConfigObject` | `createConfig()` Creates and loads the application Config
    `java.lang.Object` | `generatePluginXml(java.io.File descriptor, boolean compilePlugin = true, java.io.File targetDirectory = null )` Generates a plugin.xml file for the given plugin descriptor
    `void` | `generateWebXml(GrailsPluginManager pluginManager)` Generates the web.xml file used by Grails to startup
    `groovy.util.AntBuilder` | `getAnt()`
    `groovy.util.ConfigObject` | `packageApplication()` Packages an application.
    `void` | `packageConfigFiles(java.lang.Object from, java.lang.Object overwrite = false)` Packages any config files such as Hibernate config, XML files etc.
    `protected void` | `packageJspFiles()`
    `void` | `packagePlugins()` , *
    `void` | `packagePluginsForWar(java.lang.Object targetDir)` Packages application plugins to the target directory in WAR mode
    `void` | `packageTlds()`
    `void` | `processMessageBundles()` Processes application message bundles converting them from native to ascii if required
    `void` | `startLogging(groovy.util.ConfigObject config)` Starts the logging infrastructure

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class BaseSettingsApi` | `confirmInput, confirmInput, copyGrailsResource, copyGrailsResource, copyGrailsResources, copyGrailsResources, createXmlSlurper, enableUaa, exit, getAppClassName, getAppGrailsVersion, getBuildEventListener, getBuildProps, getBuildSettings, getConfigSlurper, getGrailsAppName, getGrailsAppVersion, getGrailsHome, getIsInteractive, getMetadata, getMetadataFile, getPluginBuildSettings, getPluginSettings, getPluginsHome, getPropertyValue, getResolver, getServerHost, getServerPort, getServerPortHttps, getServletVersion, grailsResource, isDeclared, isEnableProfile, logError, logErrorAndExit, makeApiAvailableToScripts, makeRelative, makeRelative, profile, readAllPluginXmlMetadata, readPluginXmlMetadata, resolveResources, updateMetadata, updateMetadata`
    `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()`

- - ### Field Detail

    - #### public static final java.lang.String LOGGING_INITIALIZER_CLASS

    - #### protected groovy.util.AntBuilder ant

    - #### protected java.io.File basedir

    - #### protected groovy.util.ConfigObject config

    - #### protected boolean doCompile

    - #### protected boolean packaged

    - #### protected java.lang.Object resourcesDirPath

    - #### protected java.lang.String serverContextPath

    - #### protected java.io.File webXmlFile

    - #### protected boolean webXmlGenerated

  - ### Property Detail

    - #### boolean async

    - #### java.lang.ClassLoader classLoader

    - #### java.io.File configFile

    - #### GrailsConsole grailsConsole

    - #### boolean native2ascii

    - #### GrailsProjectCompiler projectCompiler

    - #### java.lang.String servletVersion

    - #### boolean warMode

  - ### Constructor Detail

    - #### GrailsProjectPackager(GrailsProjectCompiler compiler, boolean doCompile = true)

    - #### GrailsProjectPackager(GrailsProjectCompiler compiler, java.io.File configFile, boolean doCompile = true)

    - #### GrailsProjectPackager(GrailsProjectCompiler compiler, GrailsBuildEventListener buildEventListener, boolean doCompile = true)

    - #### GrailsProjectPackager(GrailsProjectCompiler compiler, GrailsBuildEventListener buildEventListener, java.io.File configFile, boolean doCompile = true)

  - ### Method Detail

    - #### @groovy.transform.CompileStatic java.lang.String configureServerContextPath()

    - #### @groovy.transform.CompileStatic groovy.util.ConfigObject createConfig()

      Creates and loads the application Config

      Returns:
        The application config

    - #### java.lang.Object generatePluginXml(java.io.File descriptor, boolean compilePlugin = true, java.io.File targetDirectory = null )

      Generates a plugin.xml file for the given plugin descriptor

      Parameters:
        `descriptor` - The descriptor
        `compilePlugin` - Whether the compile the plugin
      Returns:
        The plugin properties

    - #### void generateWebXml(GrailsPluginManager pluginManager)

      Generates the web.xml file used by Grails to startup

    - #### @groovy.transform.CompileStatic groovy.util.AntBuilder getAnt()

    - #### @groovy.transform.CompileStatic groovy.util.ConfigObject packageApplication()

      Packages an application.

      Returns:
        true if the packaging was successful, false otherwise

    - #### void packageConfigFiles(java.lang.Object from, java.lang.Object overwrite = false)

      Packages any config files such as Hibernate config, XML files etc. to the projects resources directory

      Parameters:
        `from` - Where to package from

    - #### protected void packageJspFiles()

    - #### void packagePlugins()

      , *

    - #### void packagePluginsForWar(java.lang.Object targetDir)

      Packages application plugins to the target directory in WAR mode

      Parameters:
        `targetDir` - The target dir

    - #### @groovy.transform.CompileStatic void packageTlds()

    - #### void processMessageBundles()

      Processes application message bundles converting them from native to ascii if required

    - #### void startLogging(groovy.util.ConfigObject config)

      Starts the logging infrastructure

      Parameters:
        `config` - The config object