Closed jeremydyoung closed 7 years ago
I am not sure if it would have been better to only create the pull request, sorry if this was duplication.
Thanks for the patch, I was stuck on this.
This is a very simple and well formed pull request with integration tests. We should try to get it merged in the current release stream.
Merged to master, pending release.
I think this issue was reintroduced in v2.1.1, as I got an error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> taskdef class org.codehaus.groovy.ant.Groovyc cannot be found
Which can befixed by adding
compile 'org.codehaus.groovy:groovy-all:2.4.7'
in build.gradle
.
What Gradle version are you using?
I tried Gradle 3.5 and Gradle 2.4 with the integration test java-project-groovy-tests that is used to confirm this issue is fixed and it worked with both versions. The project is in the source tree if you want to try as well. I need more information about your specific environment and versions.
I am using gradle in a grails project with this versions:
------------------------------------------------------------
Gradle 3.5
------------------------------------------------------------
Build time: 2017-04-10 13:37:25 UTC
Revision: b762622a185d59ce0cfc9cbc6ab5dd22469e18a6
Groovy: 2.4.10
Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM: 1.8.0_51 (Oracle Corporation 25.51-b03)
OS: Windows 8.1 6.3 amd64
$ grails -version
|Grails Version: 3.2.7
|Groovy Version: 2.4.7
|JVM Version: 1.8.0_51
I needed to add in Grails 3.3.0.RC! project the dependency:
compile "org.codehaus.groovy:groovy-all:2.4.12"
With that it is running fine.
Thanks for fixing the compatibility with Grails 3 @Alex-Vol Really appreciated!
I am going to look into why Grails invocation causes this. It is quite possibly another manifestation of #59 or similar. If I can reproduce with my Grails 3 test project I can make a quick fix.
I will open an issue for this.
After spending some time looking at this issue it seems that currently it works as designed. We expect to find the Groovyc class in the compile classpath when compiling Groovy tests. This may be a side-effect of the way Grails compiles Groovy code, perhaps using the build it Gradle Groovy compile task.
This is a new issue unrelated to the original java project with groovy tests issue, that was specifically requiring a Java project to depend on Groovy. As it stands now I cannot fix it without coming up with an alternative way to compile Groovy tests and Groovy code. The workaround will have to stand as is.
If possible the provided
configuration should be used instead of compile configuration to avoid having a direct dependency of groovy if that is undesirable.
When you have a project where only the tests use groovy, the clover plugin can't locate Groovyc as seen in the error below.
The workaround is to include groovy as a compile dependency, however this is not ideal.