Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Eclipse warning: More than one scala library found in the build path #38

Open
@muhuk

Description

@muhuk

I am getting this warning on my Scala only project.

I have these two in my Scala Library container:

/home/muhuk/lib/eclipse/plugins/org.scala-lang.scala-library_2.11.8.v20160304-115712-1706a37eb8.jar
/home/muhuk/lib/eclipse/plugins/org.scala-lang.scala-reflect_2.11.8.v20160304-115712-1706a37eb8.jar

Also in the Maven Dependencies:

M2_REPO/org/scala-lang/scala-library/2.11.8/scala-library-2.11.8.jar - /home/muhuk/.m2/repository/org/scala-lang/scala-library/2.11.8/scala-library-2.11.8.jar
M2_REPO/org/scala-lang/scala-reflect/2.11.7/scala-reflect-2.11.7.jar - /home/muhuk/.m2/repository/org/scala-lang/scala-reflect/2.11.7/scala-reflect-2.11.7.jar

Plugin versions:

Eclipse SDK 4.5.2.M20160212-1500
Scala IDE for Eclipse   4.4.0.v-2_11-201604010957-ff530d2
Maven Integration for Scala IDE 0.5.1.201410131304

My POM file like like:

<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <encoding>UTF-8</encoding>
    <scala.version>2.11.8</scala.version>
    <scala.compat.version>2.11</scala.compat.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>${scala.version}</version>
    </dependency>

    <!-- Test -->
    <dependency>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest_${scala.compat.version}</artifactId>
        <version>2.2.6</version>
        <scope>test</scope>
    </dependency>
    ...
    <dependency>
        <groupId>org.scalacheck</groupId>
        <artifactId>scalacheck_${scala.compat.version}</artifactId>
        <version>1.12.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.scalamock</groupId>
        <artifactId>scalamock-scalatest-support_${scala.compat.version}</artifactId>
        <version>3.2.2</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <sourceDirectory>src/main/scala</sourceDirectory>
    <testSourceDirectory>src/test/scala</testSourceDirectory>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- disable surefire -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <!-- enable scalatest -->
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    <junitxml>.</junitxml>
                    <stdout>W</stdout>
                    <filereports>WDF TestSuite.txt</filereports>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

This is on a fresh Eclipse install. Before, removing and then adding the scala nature didn't fix the issue. So I tried to reinstall m2e stuff. JDT plugin ended up deleting eclipse binary when I uninstalled it. So I ended up creating everything from scratch.

Internets say it is just a warning, don't pay attention but I'd like to think there is a way to get rid of this warning.

Adding scala-reflect as a maven dependency brings the correct version, but doesn't help with the warning. Also, please note that both Scala IDE and maven are using 2.11.8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions