Cannot use functional test plugin on grails - grails

I am trying to use the functional test plugin (http://grails.org/plugin/functional-test) for grails. In my build config, I do:
plugins {
...
compile ":functional-test:2.0.RC1"
}
When I do
grails compile
or
grails compile --refresh-dependencies
I get:
| Error Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: com/gargoylesoftware/htmlunit/html/DomElement (Use --stacktrace to see the full trace)
Any ideas?

I use version 1.2.7 but I see the same thing the first time I run compile (or anything that triggers dependency resolution). But the second time I do it, everything works fine.

Related

Error in runing grails project after making some modification

So the project was runing in a good way till i made some modification (which i dont remember where ) when i tried to reopen the project and run it , it gave me the output below :
:compileJava UP-TO-DATE
:compileGroovy FAILED
BUILD FAILED
Total time: 10.624 secs
Error |
Gradle build terminated with error: Compilation failed; see the compiler error output for details. (Use --stacktrace to see the full trace)
i've tried to clean the project but it fail like the build , and i have no idea why this is happening cause i'm a newbie in grails and groovy .
i'am using netbeans as ide and grails v 3.0.0
sry for the bad english
i used file history to make it back to what it was , and it work .
https://i.stack.imgur.com/2B5k9.png

Grails 3.2.9 setup issue in Windows

I am moving from grails 2.5.1 to grails 3.2.9 (On Windows). I downloaded the latest zip file for grails 3.2.9. Then changed GRAILS_HOME to point to the new version and changed PATH to have GRAILS_HOME\bin.
I then executed
grails --version to confirm that the right version of grails is running.
I then created a grails app using
grails create-app bgrt2
When i execute the grails app using
grails run-app, I get a gradle error pasted below. Any help is appreciated.
C:\work3\bgrt2>
| Resolving Dependencies. Please wait...
FAILURE: Build failed with an exception.
Where:
Build file 'C:\work3\bgrt2\build.gradle' line: 19
What went wrong:
A problem occurred evaluating root project 'bgrt2'.
org/springframework/util/ReflectionUtils
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
CONFIGURE FAILED
Total time: 6.631 secs
| Error Error initializing classpath: org.springframework.util.ReflectionUtils (Use --stacktrace to see the full trace)
Firstly remove all the cached files in the Gradle cache location
C:\Users[Your_Username].gradle\caches
Then run this command to refresh you gradle
gradle --refresh-dependencies build
N.B. Grails 2 and Grails 3 is fully different where there is no config.groovy in Grails 3. You need to configure everything in application.yml
You need to define your project name in application.ymlat line no. 5 as like
defaultPackage: bgrt2

"No builders" error GrailsClasspath when running grails run-app

When running grails run-app I get the following error:
| Error Error initializing classpath: No builders are available to build a model of type 'org.grails.gradle.plugin.model.GrailsClasspath'. (Use --stacktrace to see the full trace)
Any ideas anyone?
This is logged as an unresolved issue presently: https://jira.grails.org/browse/GRAILS-12079
I'm seeing this same issue with both grails 3.0.11 and 3.1.1. I was able to get around it for my project by installing grails 2.4.5 then executing grails set-grails-version 2.4.5.
Just had the problem where i took an existing grails project. That grails project was specified as 3.0 but actually contained many references to 2.5 in the build.gradle
Had To make changes to the gradle configuration to make it run.
To get you on track: create a new app somewhere and compare the gradle configuration between the 2

Error loading UrlMappingsPlugin in Grails

When creating a basic grails plugin and compiling with Maven, I get this error message:
Error loading plugin manager: Could not create a new instance of class
[org.codehaus.groovy.grails.plugins.web.mapping.UrlMappingsGrailsPlugin]!
(Use --stacktrace to see the full trace)
Grails version 2.4.3
The solution to this issue is to add the tomcat plugin (no idea why):
Add this to BuildConfig.groovy:
build ":tomcat:7.0.55"
Then you may need to regenerate the pom.xml file using grails create-pom.
This appears to be related to this bug.

error while running grails command line

in my grails 2.3.4 application (after upgrading from grails 2.2.3) , when I run the grails command line grails install-plugin pluginname I get the below error , even I tried grails list-plugins I'm getting the same error:
Error Resolve error obtaining dependencies: Failed to resolve dependencies (Se log level to 'warn' in BuildConfig.groovy for more information): org.grails.plugins:tomcat:2.3.4 (Use --stacktrace to see the full trace)
i reviewed the BuildConfig.groovy there is no tomcat 2.3.4 what i'm using is 7.0.47 , here are my plugins :
runtime ":hibernate:3.6.10.6"
runtime ":jquery:1.8.3"
runtime :resources:1.1.6
build ":tomcat:7.0.47"
runtime database-migration:1.2.1
compile :cache:1.0.1
how i can solve this issue ?
you problem seems slovable due to the fact that ...you need to clean the grails project first without building it and then do
grails refresh-dependencies
and then finally
grails clean
and
grails compile
When you run refresh-dependencies your Grails application will try to resolve your grails plugins defined in BuildConfig.groovy file. If this doesn't work remove the plugins and do the above step until the error you have posted in the question vanished then add the correct plugin format and version with the correct precedence dependency, then make sure everything should work well.
Your dependencies are in a dependency block, but they are plugins. Put them in the plugins block of your BuildConfig.groovy file. So instead of what you have, put this:
plugins {
runtime ":hibernate:3.6.10.6"
runtime ":jquery:1.8.3"
runtime ":resources:1.1.6"
build ":tomcat:7.0.47"
runtime ":database-migration:1.2.1"
compile ":cache:1.0.1"
}
Also, this is no "dependency" block. This is a dependencies block, however. See this link for information on dependency resolution in Grails.
I need to add the following repo in buildconfig.groovy to the repositories section:
mavenRepo "https://repo.grails.org/grails/plugins"

Resources