Grails Build Test Data plugin having AST issues with Eclipse - eclipse

I didn't have this problem before but now it just appeared and I don't know how to fix it. I tried it on many different Eclipse versions but I get the same problem.
Groovy:Unable to run AST transform
grails.buildtestdata.mixin.BuildTransformation: missing class
grails/buildtestdata/mixin/BuildTestDataUnitTestMixin: are you
attempting to use groovy classes in an AST transform in the same
project in which it is defined?
http://groovy.codehaus.org/Eclipse+Plugin+2.0.0+FAQ#EclipsePlugin2.0.0FAQ-Q.DoesitsupportcustomASTtransformations%3F

Could appear after a grails clean.
Run Grails Tools -> Refresh Dependencies and after that Project -> Clean....

Make sure that your groovy version is correct for your version of Grails. I had the same issue while compiling a file with groovy 2.3 and then when the compiler got upgraded to 2.4 the #Build annotation failed, the AST transform did not work properly.

Related

Different version of scala lib in build path and scala-ide

I have two versions of scala (2.11.4 and 2.10.4). Currently I work on project based on scala 2.10. I've changed version in project properties but ide still complains about it:
The version of scala library found in the build path (2.10.4.) is different from the one provided by scala IDE (2.11.4.). Make sure you know what you are doing.
I am using
Scala IDE build of Eclipse SDK
Build id: 4.0.0-vfinal-20141216-1226-Typesafe
Project config:
Any idea how fix that?
That complaint is a warning, not an error; all is fine. I suspect the message is mostly left over from when scala-ide used to only support working with a single version of scala in a single install (which was only fixed in 4.0)
Yes, you can use the multiple scala version support, as described in this blog post.
Once correctly configured, as you showed in the image, this is just a warning and therefore safe to ignore.

Grails compiler mismatch

I am getting a message for when I start a new Grails project that project level is 2.1 and workspace level is 2.0.
When I go to preferences>Groovy>compiler it say the current version that I have is 2.0.7.
I have also tried right clicking on the project and then choosing Groovy>fix compiler mismatch problems.
I am using eclipse Kepler j2ee on a mac and using grails 2.3.3. How can I fix the program?
I think you should change your groovy compiler version to 2.1.5
Currently i use Grails.2.3.0 under preference->grails
and my groovy has been selected like this one You are currently using Groovy Compiler 2.1.5
There is a Switch to Selection for Groovy Compilers --but i suggest
Makes usre your groovy package has been insatlled or package is not corrupted and correct.
Change or install groovy compiler 2.1.5 that works fine with Grails 2.3.0 or Grails 2.3.3
and Make Refresh Dependency To your Project...
Right click on project. Go to Properties.

Scala Eclipse IDE - strange behavior

I am giving a try to Scala Eclipse IDE after a very long time. I installed Eclipse and the said Scala plugin only a while ago, but I am unable to get stuff working. In all of the Scala files, I get the errors like following (See the tooltip):
This project uses Gradle for building, and I also have the latest version of Groovy plugin installed. Please help me get this thing working. Thanks.
Edit:
Thank you, everyone. The problem was solved. It appears there was a problem with my Scala plugin installation. A complete reinstall of everything (including Eclipse) helped. Also, this time I did not install the Groovy plugin.
I don't know which version of Eclipse / Scala-IDE you're using, but there are two reasons I know this sometimes happens:
1) You don't have JDT weaving for Scala installed.
The scala-ide uses aspects to weave in code into the JDT compiler. If you don't have this installed, this may cause the Scala files to be seen as Java files.
2) If, somehow, the Java Source File content type includes *.scala. In fact, it should be Scala Source File. If this is the case, you should remove the *.scala from the Java Source File content type.

Problem on error highlight using IntelliJ 10 CE with the scala plug-in

I'm having some strange behavior in the IntelliJ editor when editing scala sources. It continuously report problem of kind "cannot resolve symbol" on various Predef functions like "require" and "->".
It seems to be only an editor problem because I am able to run scala code in Intellij and compile the sources using maven.
Am I the only one having this kind of problem ?
I'm using the Intellij version 10.0.3 CE and scala plugin version 0.4.735.
Thanks.
I would recommend using the latest IntelliJ IDEA EAP together with the latest Scala Plugin. This is known to solve a lot of problems.
Please, check the project configuration guide. It's likely that you forgot to add Scala standard library to the module dependencies.

Groovy + Eclipse

I have a simple question regarding groovy with eclipse. I downloaded the plugin as mentioned and i didnt have problems with installations but i have compiler errors in hello p. the problem in my opinion that eclipse isnot using the groovy compiler. but i have no idea what to do
Is the filename extension .groovy?
Are you sure the project has the Groovy nature? (right-click on the project, and ensure Remove Groovy Nature appears. If Add Groovy nature appears, then the project doesn't have a groovy nature, and therefore the groovy compiler won't work).
Could you also post the file that isn't compiling. There might be something wrong with what you typed.
Make sure you are opening the file in a Groovy editor.
Look for any exceptions in your error log.
Also, just in case, you can try uninstalling and reinstalling the plugin. I'd recommend using the latest milestone version as that one is about to be promoted to 2.1.2 final.
http://dist.springsource.org/milestone/GRECLIPSE/e3.6/
I confirmed that Groovy plugin isnot workingn on mac. I tried it on 2 machines and they are giving the same error. Groovy plugin is working on windows without problems :)
NetBeans is a better option for Groovy+Java development. You can mix Java and Groovy files in a Java project in NetBeans. It also creates a distributable jar for your project. No classpath and jar issues with NetBeans created MET-INF file.