1
votes

I have grails app that uses plugins to modularize app. Structure of app is as follows:

  • pluginA
  • pluginB
  • pluginMain

On one of those plugins (say pluginA) I have controller that uses Spring Webflow (using Spring Webflow 2.0.8.1).

Plugins are resolved locally in BuildConfig.groovy of pluginMain (grails.plugin.location.'pluginA' = "../pluginA" grails.plugin.location.'pluginB' = "../pluginB").

When running app with run-app views used by webflow are resloved OK.

But, when I run app with run-war controller from pluginA tries to resolve view from location pluginMain/WEB-INF/grails-app/views/controllerName/flowName/nameOfView.jsp instead from pluginA so I am getting HTTP 404 not found error.

I am using grails 2.3.7 and java jdk 1.7.

Please help!

1

1 Answers

0
votes

The location that it is looking for in the run-war situation is the standard location for resolving page and flow views. You are likely getting into trouble by attempting to create a war file using inline plugins (the grails.plugin.location).

The inline plugin support is really nice when developing plugin functionality, but it has its quirks, particularly when you get multiple dependent plugins in play. At some point you have to break down and start publishing your plugins.

Try publishing the plugin to your local Maven repository using the "maven-install" command. Then change your BuildConfig.groovy file to reference the installed version of the plugin.

My normal workflow is something like this:

  1. Develop the new plugin functionality using an inline plugin definition in BuildConfig.groovy, testing with run-app and run-test until I'm happy.

  2. Publish a SNAPSHOT version of the plugin (ie. 1.0.1-SNAPSHOT) and update BuildConfig.groovy to point to the snapshot and test using run-app and run-war eg:

    compile (":ark-kpi:1.0.1-SNAPSHOT")

  3. Publish your plugin in release form either to your local maven repository (maven-install) or a public repository like a locally running Artifactory if you want to share with colleagues (publish-plugin).

You should read the guide section on plugins and configuration for details on setting up repositories.