0

I have tried various versions of scala(2.9,2.10,2.11) with various ide types like Eclipse+Scala plugin, Whole Scala IDE downloaded from scala website, IntelliJ Idea etc. Eclipse versions won't open the editor properly for files having *.scala extension, and they always throw "Syntax error on token" error, even though JDT weaving etc is enabled. Intellij Doesn't compile the code on save changes or Make. Since I have to use Maven build, I have to do mvn install always to get changes reflected in Intellij. I have been struggling hard to get this scala + eclipse ide setup working and doing some projects from last 1 week without any luck. Please apologize if this is not the right question to be asked here, but considering my less time to get started with Scala, Please suggest some good reference/links to understand configuration matrix (Scala + Eclipse ide) for Maven based project to start working

Thanks

Chakri
  • 13
  • 1
  • 6

1 Answers1

0

I've long given up using Eclipse as an IDE for Scala (or for anything else). I'm successfully using IntelliJ IDEA for my Scala development (since version 10. or 11., currently 14.0.2) I'm also using Maven exclusively for building on the command line. This usually works very well for Scala 2.11, 2.10 and probably also 2.9.

You have to add a Maven Scala compiler plugin to the pom.xml files in order for Intellij to configure the project accordingly. For example:

<properties>
    <scala.version>2.11.4</scala.version>
</properties>

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.2.0</version>

                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>

                <configuration>
                    <!-- Allows for IntelliJ to pick up the correct library version. -->
                    <scalaVersion>${scala.version}</scalaVersion>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

    <plugins>
        <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>
Horst Dehmer
  • 369
  • 1
  • 10