I am facing a weird situation with Eclipse Oxygen. I did as follow:

  • Created a Maven Project
  • Added Scala Nature
  • Changed Scala compiler to 2.10.6
  • Added a dummy hello world object

like:

object SSHbaseApp extends App{
  println("Running SSHbaseApp...")
}

And Eclipse gave me the option to Run As... Scala Application

Then I added a few packages in the pom:

<dependency>
    <groupId>net.ceedubs</groupId>
    <artifactId>ficus_${scala.compat.version}</artifactId>
    <version>0.1.1</version>
</dependency>

The I Run As... Maven Install and I then eclipse doesn't give me the option of Run As Scala Application any more.

I commented out these two packages I added in the POM, repeat the Maven Install and then I am able to keep running as Scala Application.

Anyone knows why this may be happening?

The whole POM.xml looks like this now:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.ignacioalorre</groupId>
    <artifactId>SparkStreamingHbaseSandbox</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>SparkStreamingHbaseSandbox</name>
    <url>http://maven.apache.org</url>

    <properties>
        <scala.compat.version>2.10</scala.compat.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>

        <dependency>
            <groupId>com.typesafe</groupId>
            <artifactId>config</artifactId>
            <version>1.2.1</version>
        </dependency>

        <dependency>
            <groupId>net.ceedubs</groupId>
            <artifactId>ficus_${scala.compat.version}</artifactId>
            <version>0.1.1</version>
        </dependency>

    </dependency>


    </dependencies>
</project>

1 Answers

0
Eduardo Mendes On Best Solutions

Still not 100% sure if it was my mistake or a bug in Eclipse, but I was able to sorted out in the following way.

Firstly I notice a red exclamation mark next to my project name. Maven was showing BUILD SUCCESS, but some errors were still there.

I checked what was the error and it said:

Error in Scala compiler: object scala.runtime in compiler mirror not found. SparkStreamingHbaseSandbox Unknown Scala Problem

I solved this one by going into:

Properties -> Scala Compiler -> Scala Installation I changed from Latest 2.10 bundle (dynamic) to Fixed Scala Installation: 2.10.6 (built-in)

After a new build with Maven the exclamation mark and the errors disappear. But it still didn't let me Run my app as Scala Application.

So last step was to close that project inside eclipse and reopen again... And problem solved.