0

I am trying to build a groovy+java+maven project in Eclipse. New to setting up groovy with Eclipse so I am possibly missing out a bunch installations. I did the following thus far -

Downloaded Groovy Eclipse and Groovy Eclipse M2E version 2.9.1 (Followed this page - http://www.vogella.com/tutorials/Groovy/article.html)

My pom has these -

<dependency>
    <groupId>org.codehaus.groovy</groupId>
    <artifactId>groovy-all</artifactId>
    <version>2.3.7</version>
</dependency>

<build> 
<plugins> 
    <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <!-- 2.8.0-01 and later require maven-compiler-plugin 3.1 or higher -->
    <version>3.1</version>
    <configuration>
      <compilerId>groovy-eclipse-compiler</compilerId>
    </configuration>
    <dependencies>
      <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-eclipse-compiler</artifactId>
        <version>2.9.1-01</version>
        <!--  extensions>true</extensions -->
      </dependency>
      <!-- for 2.8.0-01 and later you must have an explicit dependency on groovy-eclipse-batch -->
      <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-eclipse-batch</artifactId>
        <version>2.3.7-01</version>
      </dependency>
    </dependencies>
  </plugin>
</plugins> 

I can't seem to get any content assist in my groovy class under src/main/groovy. I tried using some of the java.util classes like Collection. I am able to get content assist as usual for java classes in src/main/java.

Under Prefereces > Java > Editor > Content Assist > Advanced "Groovy Content" is checked.

So what am I missing? Thanks in advance for your suggestions.

chapstick
  • 713
  • 6
  • 16
  • 25
  • http://stackoverflow.com/questions/23354680/eclipse-content-assist-not-working-for-java-objects-within-groovy-files – tim_yates Jan 29 '16 at 15:45
  • thanks I saw that link. It didn't work for me. Completion is only working in Java files – chapstick Jan 29 '16 at 15:51
  • 1
    1) if you don't have a Maven requirement, using Gradle with Groovy has been much easier in my experience, 2) evaluate IntelliJ IDEA for Groovy based projects. – Todd W Crone Jan 31 '16 at 16:15
  • Agree, I've used Groovy for years in IntelliJ and it's almost as pleasurable to work with as with Java (the only things missing are a few refactorings which are too hard to do right in dynamic languages anyway). – Renato Feb 01 '16 at 03:16
  • @ToddWCrone and Renato thanks for your responses. Maven is a must. I gave intellij a try but wanted to get it working in eclipse bcz thats what I am using for all the other projects – chapstick Feb 01 '16 at 13:31

0 Answers0