I have added the following entry to BuildConfig.groovy:
compile ":rest-client-builder:2.1.1"
The plugin supposedly installed correctly and the project compiled.
I am trying to import the RestBuilder class in a controller but the class name cannot be resolved?
import grails.plugins.rest.client.RestBuilder
Groovy:unable to resolve class grails.plugins.rest.client.RestBuilder
I have no spent an hour and a half trying to figure out why this is not working. I am not sure what else to do or what information to provide as to get this working. Can anyone well versed in groovy explain how this could be or offer some advice??
Thank you
I used grails clean-all and grails compile from grails console(Windows command prompt).
Using the same in intellij(v15.0) run target did not work for me.
Related
Hi I am facing an issue with eclipse. currently i have a java project using maven/springboot and i am using http://mapstruct.org/ libraries to generate some classes.
In my test I am declaring the generated classes (implementation) however the eclipse complain it could not be resolved to a type.
when i do a maven clean package from the terminal all the tests pass . Also i can see that the generated classes under the folder target/annotations/com/primecast/service/mapper/ , basically it is generated successfully . However when i declare an instance of the class like this from my junit test
private ProfileMapperImpl profileMapper
it shows cannot be resolved to a type. However i can find the ProfileMapperImpl class generated properly under the folder target/annotations/com/primecast/service/mapper/
any idea how can i add the generated source files to my eclipse so that the eclipse wont complain . my eclipse version is eclipse photon released on 2019.
thank you for reading my question.
I hope you are seeing the error in eclipse IDE at the import's section while trying to add the import statement of the implementation class. If that is the case, simply remove the import statement. The application should still be able to resolve the class without errors. That is what worked for me.
I have created a Play framework 2.3.8 (Scala) project successfully, and ran it successfully as well. I just installed Intellij IDEA 14.1 and installed the Scala plugin during installation too. I am now trying to import the created project into the IDE; but I just can't find any guides to get me through it. I am stuck here, as the images there show you. Any comprehensive help would be very much appreciated. Should I download anything further than what the default procedure does during the project creation with the Play Framework? If not, how do I set up the settings on the screen shown in the images on the page at the link provided above.
See the "\bin\bin" in the error message? It looks like you should remove the \bin from the path to the JVM - it should be just c:\program files\java\jdk1.8.0_40.
Trying to bootstrap my boilerplate Scala Spray project on Heroku, I am trying to add the necessary tweaks to my local project as per the Heroku documentation. The spray boilerplate project has been derived from the excellent template at github that simply works and has elegant code and tests included.
After the last mentioned template project worked great, when adding the line import com.typesafe.startscript.StartScriptPlugin to my build.sbt, any sbt command now fails with:
/build.sbt:1: error: object typesafe is not a member of package com
import com.typesafe.startscript.StartScriptPlugin
^
[error] Type error in expression
Being on Ubuntu desktop 13.04, I tried installing the full typesafe stack, although everything else worked with only a local installation of a more recent version sbt till this point. But this attempt at getting this error solved doesn't change anything. Which seems in my case to place getting-ready-for-Heroku at a dead end.
I guess this integration problem may be simple to nail down, but there's too many moving parts for me here and maybe there's a simple insight that can get me unstuck here... it feels on Google like I'm probably the only one having encountered this specific problem.... but maybe the solution is dead simple for you.
Looks like this combination works with sbt 0.12.0 but not 0.12.4 nor 0.13.0.... changing the sbt project to 0.12.0 makes it work.
I tried to use the worksheet plugin in eclipse in combination with a play project but it doesn't seem to work. Every import is marked as not being found.
Has anyone got this working, is there anything special I need to do?
Yeap, I had that problem. What I've done to solve it was:
If you're not using it, I would recommend you start using Scala-IDE for eclipse
Even though I've previously got scala-ide, when I tried to use scala worksheet with a play project I still had that problem. I tried to do the default action to the scala worksheet plugin when you have a computer problem: reboot-update-reboot. And it worked! The version of Scala Worksheet that I'm currently using is (as seen in my Eclipse Installation details):
Scala
Worksheet: 0.1.2.v-2_09-201210230838-85b738a
Check if your version is the same as mine. If it's try to remove it and install it againt. If it isn't, then try to update it. Tell me if it works.
Cheers!
the question is a bit general, but:
if worksheet is working correctly without play framework => problem should lies in the installment of the framework:
did you update PATH (http://www.playframework.org/documentation/2.0.4/Installing)?
is command play help working ?
You are asking about Play's Eclipse plugin specifically:
did you follow guide at http://www.playframework.org/documentation/1.0.1/ide#eclipse ?
Which step didn't work for you?
I am working on a small webapp and I want to use Groovy to write some unit testing for my app. Most of my coding is done on Eclipse and I really want to run all the unit testing with the graphical test runner within Eclipse (I really like the green bar :) )
Sadly, after 4 hours of try-and-error, I'm still not able to setup properly. I tried to use the Eclipse Junit4 test runner to run a Groovy file with method annotated for testing using #Test. But it keeps complaining NoClassDefFoundException
Anyone can help?
Here is content of my groovy file, named simpleTest.groovy
import org.junit.Test
import static org.junit.Assert.assertEquals
class simpleTest{
#Test
void trial(){
assertEquals 6, 3+3
}
}
Anyone can help?
You might want to give the updated plugin a try, see the the recent blog post for more details. The theme of this alpha release is providing an optimized edit/save/compile/test experience, which seems to be your exact use case.
I have this working in my environment so here is a brief summary of what I have:
In the run dialog under JUnit:
Test Tab: The test class, this must have already been compiled by the Groovy plugin.
Classpath: All of the Jar files from my project as well as the Groovy Libraries library
In Window->Preferences->Java->Build Path
Classpath Variables: GROOVY_ECLIPSE_HOME = the location where the Groovy plugin is installed
That does the trick for me.
Unfortunately, the Groovy Eclipse plugin is pretty horrible at giving actual helpful information to let you know what is going wrong with your setup. I'm going to assume you already did the verification to make sure the plugin is actually building your Groovy files (i.e. doing a sample with no dependencies, checking the properly output directory, etc...) After that, it's a lot of really small configuration verification...I've run into problems where the particular "runner" I'm using in Eclipse (i.e. in the Run menu) doesn't have the write class name defined there or for some reason my project didn't get the JUnit library dependency properly inserted into it.
Ultimately, it can be a configuration headache, but long term you'll end up saving some time and gaining some cool functionality if you can knock it out...
I had faced a similar issue and it was the missing package statement that caused me to have problems. Groovy Eclipse plugin did not complain about it but my class was present in a package. I got the noClassDefError when running the file as a JUnit Test.
Adding the package statement to top of class solved this issue.