grails/grails-maven — pull request #49 by apottere (2014-07-17 17:42:09+00:00)
Title: Fix groovy version error and add support for unforked grails runs.

Upon exploring using grails-2.4.2 with the grails-maven plugin, we ran into three problems:

First, the 2.4.2 plugin had removed a dependency on groovy (while keeping the groovy.version property around), which caused the plugin to attempt to download groovy-2.4.2. We added this dependency back to the pom.

Secondly, logback dependencies were omitted from the list of logging jars to add to the classpath. We added "logback" to the whitelist.

Lastly, the plugin has a boolean configuration for "fork", but it doesn't seem to actually honor it. For compiling and testing this is fine, but it seems to cause problems when running the application with grails:run-app. To mitigate this, we:

* Extracted common runner code to an abstract class that ForkedGrailsRuntime extends from.
* Added a new class, DefaultGrailsRuntime, that runs the launcher in the same JVM.
* Used the "fork" option to determine when to use one or the other.

The result is that, assuming the following pom.xml "build" section:
```

org.grails
grails-maven-plugin
${grails.maven.plugin.version}

${grails.fork}
...

...

```
running `mvn -Dgrails.fork=false grails:run-app` will run the grails process natively. Not only does this guarantee the classpath is set up correctly, but it also allows debugging from an IDE with a single run configuration.