Announcement Announcement Module
Collapse
No announcement yet.
Adding Groovy support to existing simple project in STS Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding Groovy support to existing simple project in STS

    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

  • #2
    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.

    Comment


    • #3
      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

      Comment


      • #4
        Have you tried:

        Select project -> Right click -> Configure -> Convert to Groovy project?

        Comment


        • #5
          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

          Comment


          • #6
            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.

            Comment


            • #7
              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

              Comment


              • #8
                Originally posted by bgardner View Post
                Andrew,
                You can't (apparently) add groovyness to a project that was created as a simple project.
                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.

                Comment


                • #9
                  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

                  Comment

                  Working...
                  X