Details
Description
Running 'grails war' should make a deployable war artifact that includes all dependencies required by in-line plugins. This does not currently work in 1.2.
See the below emails:
It appears the inline plugin dependencies are not picked up:
_GrailsWar.groovy 90: target (war: ... 115: packagePluginsForWar(stagingDir)_PackagePlugins.groovy 84: packagePluginsForWar def pluginInfos = pluginSettings.getPluginInfos(pluginsHome) for(PluginInfo info in pluginInfos) { try { def pluginBase = info.pluginDir.file def pluginPath = pluginBase.absolutePath def pluginName = "${info.name}-${info.version}" packageFiles(pluginBase.path) if(new File("${pluginPath}/web-app").exists()) { ant.mkdir(dir:"${targetDir}/plugins/${pluginName}") ant.copy(todir:"${targetDir}/plugins/${pluginName}") { fileset(dir:"${pluginBase}/web-app", includes:"**", excludes:"**/WEB-INF/**, **/META-INF/**") } } }The only things copied here (in our case) are css/, images/, and js/.
Bouncing back to _GrailsWar.groovy 172: if(includeJars) { def pluginInfos = pluginSettings.supportedPluginInfos GrailsPluginManager pm = pluginManager pluginInfos = pluginInfos.findAll { info -> pm.supportsCurrentBuildScope(info.name) } if(pluginInfos) { ant.copy(todir:"${stagingDir}/WEB-INF/lib", flatten:true, failonerror:false) { for(PluginInfo info in pluginInfos) { fileset(dir: info.pluginDir.file.path) { include(name:"lib/*.jar") } } } } }You can see that lib/*.jar files are copied to the war artifact but no
mention of the DSL functionality.I believe I've scanned this code correctly. If no one objects I will
open a JIRA on the issue.
- Chris
We are using the inline plugin capability of Grails 1.2 to modularize
our application. It has worked nicely so far but we've hit a bit of a
problem.Our plugins are used inline to reduce the install plugin cycle.
BuildConfig.groovy: final String MODULES_DIR = 'modules' grails.plugin.location.foo = "$MODULES_DIR/foo" grails.plugin.location.bar = "$MODULES_DIR/bar"Etc.
When we build the main application our plugins are picked up and
executed as expected. So far so good.Our plugins define their dependencies using the new 1.2 DSL like so:
dependencies { final String JBOSS_VERSION = '4.2.3.GA' build 'javax.jms:jms:1.1', "jboss:concurrent:$JBOSS_VERSION", // concurrent.jar "jboss:jboss-common-client:$JBOSS_VERSION", // jboss-common-client.jarEtc.
When we issue a run-app command in our top most Grails app the
dependencies are picked up and things work as expected. We can run the
plugins individually (test-app, run-app) and things work as expected.The problem begins when we attempt to package the top most Grails app.
Our war does not pick up the dependent jars. Is this expected? Are we
supposed to define the dependencies in our top most application?We are looking for any guidance here from teams that are doing the same
thing.Thanks,
Chris
Examples that work