Grails 3.3.x with gradle 4.x does not work? - grails

Grails 3.3.0 does not work with gradle 4.x is that right?
I have problems running intergation test (dependency injection does not work) when running them with gradle via integrationTest or build task.
BTW: Why isn't there a grails-3.0 tag?

Grails 3.3.0 does not work with gradle 4.x is that right?
It really depends on what you are doing, but there have been issues identified. https://github.com/grails/grails-core/issues/10713

Related

How do I know what webserver gradle / grails is using?

This thread: Gradle / Grails application describes how to set up the grails plugin for gradle.
The command gradle grails-run-app tries to start the grails application on port 8080. What webserver is gradle using here?
Does it have an embedded one? If so how can I access / configure it?
It just shelling out to the same thing that Grails would have done without Gradle, as if you had run grails run-app. That depends on which server plugin you have installed. By default it's http://grails.org/plugin/tomcat, but you can switch to http://grails.org/plugin/jetty by changing the values in grails-app/conf/BuildConfig.groovy
Gradle is nothing but a build and config tool like maven. When you use it with Grails app the dependencies are managed by it as it happens when maven is used.
When you use gradle grails-run-app it does nothing more other than running grails run-app from its own context. The same embedded Tomcat server is used by default.

Jenkins + Grails or Jenkins + Gradle + Grails

I have a grails project. I want to set up some CI for it. Are my better off calling grails commands directly from Jenkins or using Jenkins to call Gradle to call Grails commands.
The reason I ask is that when using Gradle with Grails most Gradle stuff just calls out directly to Grails commands.
Thanks
The easiest is to use the (built-in) grails wrapper (http://grails.org/doc/latest/guide/single.html#wrapper).
You would then run
./grailsw refresh-dependencies
./grailsw test-app
First line to setup (install all plugins etc.) grails and second to run your tests.
The advantage of grails wrapper is that it takes care of downloading & installing the correct grails version. Which is very useful if you upgrade grails. You don't have to do anything on your ci server.
There is also a grails plugin for jenkins (https://wiki.jenkins-ci.org/display/JENKINS/Grails+Plugin) that supports the grails wrapper.

exclude transitive plugin dependencies

I've installed the asynchronous mail plugin into a Grails 2.1.4 application. This plugin has a dependency on version 2.1.1 of the Hibernate plugin, whereas my app depends on version 2.1.4 of the Hibernate plugin.
Every time I execute a Grails command like run-app, I am asked the following question:
You currently already have a version of the plugin installed [hibernate-2.1.4]. Do you want to update to [hibernate-2.1.1]? [y,n] n
I know that run-app has an --non-interactive argument, but AFAIK this will automatically answer y to this question. Ideally, I would like to solve this problem by excluding the transitive Hibernate plugin dependency from the asynchronous mail plugin, but transitive dependency exclusion only seems to be possible for JAR dependencies.
The docs in the plugin page are wrong - you need this for any Grails app not using version 2.1.1, not just older apps:
compile(":asynchronous-mail:1.0-RC3") {
excludes 'hibernate'
}

Can you use the Grails Wrapper to upgrade Grails?

I can't find anything in the Grails docs, but from the wording of the description of the Grails Wrapper, it should be possible.
Can you use Grails (via an installed Grails Wrapper) to upgrade the version of Grails a project (and thus the Wrapper) is using? If so, how?
TIA,
g.
I used to just change grails version in application.properties file and run grailsw wrapper to upgrade wrapper. However this doesn't work when upgrading from 2.1.x to 2.2.x anymore.

Grails dependencies or Maven

I'm using STS latest version (2.7) and latest grails as well. After I created a freshly grails project in STS it freezes in the updating grails dependencies for a long time and it comes out as a timeout error. And it follows by some GroovyObject error, but the project still runs fine in command-line. So I ditched STS for refreshing dependencies, and I included the dependency in BuildConfig.groovy and use grails compile but I still got ClassNotFound error when compiling, it's like grails didn't pick up the Ivy CLASSPATH. So, I'm thinking of changing it to Maven to resolve any dependencies.
My question would be which one is better and integrated seamlessly in STS or Eclipse?, but I still want to use grails commands, not maven.
If your project is just a grails project - use grails dependencies.
I've experience with mavenized grails project, and plain grails project. First is good when you have multimodule project, and only one of them is grails module. At this case you'll lost all grails commands, you need to use commands like mvn grails:run-app and it's complicated thing to pass arguments into commands :(

Resources