I have a simple project that a number of people are sharing, and want to add Groovy and JUnit4 support to it. Is there an easy way to do that?
Brian Gardner
I have a simple project that a number of people are sharing, and want to add Groovy and JUnit4 support to it. Is there an easy way to do that?
Brian Gardner
Have yo uinstalled the Groovy-Eclipse plugin from the extensions page? We have a simple getting started tutorial here:
http://groovy.codehaus.org/Eclipse+P...roovyEclipsev2
Once you create a groovy project, you can share it via scm and other people can use it as well.
To get JUnitr support, all you need to do is add the JUnit4 classpath container:
1. Select rpoject
2. Right click -> Build Path -> Configure Build path...
3. Libraries
4. Add library... -> Junit -> Version 4
Hope this helps.
Andrew Eisenberg, Ph.D.
SpringSource, a division of VMware
SpringSource Tools Team
More about AJDT, Groovy-Eclipse, and Grails tooling
Andrew,
Thanks for the quick response. Perhaps I was unclear though - I have created many Groovy projects with JUnit; that's easy. This is an existing project that is simple - nothing more than a directory structure, really. I need to add the ability to run Groovy JUnit tests to that one.
Brian
Have you tried:
Select project -> Right click -> Configure -> Convert to Groovy project?
Andrew Eisenberg, Ph.D.
SpringSource, a division of VMware
SpringSource Tools Team
More about AJDT, Groovy-Eclipse, and Grails tooling
Yeah, that option does not appear for me, even though all sorts of other Groovy things work well. I do have "Convert to Grails Project" however. Not useful in this case. Is there a way to add that feature? I may have missed a setup issue when I moved machines recently...
Brian
Are you sure that your project is not already a groovy project? When you right click on the project, do you see a "Groovy" menu item?
Is the problem that you don't have the groovy libraries on the project's build path? Right-click -> Groovy -> AddGroovy Libraries to classpath.
Andrew Eisenberg, Ph.D.
SpringSource, a division of VMware
SpringSource Tools Team
More about AJDT, Groovy-Eclipse, and Grails tooling
Andrew,
No, this project was created as simply a directory in Subversion, and checked out in STS for version control of the (mostly SQL) files in there. Afterward, I wanted to add Groovy unit tests to it. I have those in another project currently, and I may just merge that "project" in the test directory of the Subversion repo. You can't (apparently) add groovyness to a project that was created as a simple project.
Brian
That's correct. I misunderstood your original post and didn't know that you were not working with a non-java project. A project must be a java project before it can be a groovy project. AFAIK, there is no automated way to convert a simple project to a Java project. You can, however, just edit the .project file and add the Java nature (copy the syntax from an existing java project).
Let me know if this fixes your problem.
Andrew Eisenberg, Ph.D.
SpringSource, a division of VMware
SpringSource Tools Team
More about AJDT, Groovy-Eclipse, and Grails tooling
I did the easier thing, and committed the separate Groovy project to a test directory under the un-Java-like project. It looks like two projects in my Package Explorer, but the code is all kept together in SVN.
I am king of the land of good enough...
Brian