Scala SuperSafe 社区插件工件、sbt 0.13、scala 2.11.8 未解析

Scala SuperSafe Community Plugin artifact, sbt 0.13, scala 2.11.8 not resolving

我想使用 ScalaTest in my Scala project more specially the SuperSafe Community Edition。我按照安装说明进行操作,我使用的是 sbt 0.13 和 scala 2.11.8。

我收到以下错误:

[error] (*:update) sbt.ResolveException: unresolved dependency: com.artima.supersafe#sbtplugin;1.1.0-RC6: not found

我尝试使用与 scala 2.11.8 相关的其他工件,但没有成功。

我可以将 SuperSafe Community Edition 与 sbt 0.3 和 scala 2.11.8 一起使用吗?

出于内部原因,我切换到基于 Maven POM 的项目。以下是我使用的依赖项:

<?xml version='1.0' encoding='UTF-8'?>
   <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0        
              http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0">
    <modelVersion>4.0.0</modelVersion>
    <groupId>default</groupId>
<artifactId>my-project</artifactId>
<packaging>jar</packaging>
<description>My Project</description>
<version>1.0</version>
<name>data-transformer</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <scala.binary.version>2.11</scala.binary.version>
    <scala.version>2.11.8</scala.version>
    <spark.version>1.6.1</spark.version>

    <junit.version>4.12</junit.version>

    <compiler.plugin.version>3.5</compiler.plugin.version>
    <project-info-reports.plugin.version>2.9</project-info-reports.plugin.version>
    <site.plugin.version>3.4</site.plugin.version>
    <surefire.plugin.version>2.19.1</surefire.plugin.version>

    <scala.plugin.version>3.2.2</scala.plugin.version>
    <scoverage.plugin.version>1.1.0</scoverage.plugin.version>
</properties>

<build>
    <sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
    <testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${compiler.plugin.version}</version>
            <configuration>
                <skipMain>true</skipMain> <!-- skip compile -->
                <skip>true</skip> <!-- skip testCompile -->
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${surefire.plugin.version}</version>
        </plugin>

        <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <version>${scala.plugin.version}</version>
            <configuration>
                <scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
                <scalaVersion>${scala.version}</scalaVersion>
            </configuration>
            <executions>
                <execution>
                    <id>default-sbt-compile</id>
                    <goals>
                        <goal>compile</goal>
                        <goal>testCompile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.scoverage</groupId>
            <artifactId>scoverage-maven-plugin</artifactId>
            <version>${scoverage.plugin.version}</version>
            <configuration>
                <scalaVersion>2.11.8</scalaVersion>
                <highlighting>true</highlighting>
            </configuration>
        </plugin>
    </plugins>

    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${site.plugin.version}</version>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

<dependencies>
    <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>2.11.8</version>
    </dependency>
    <dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-core_2.11</artifactId>
        <version>1.6.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-hive_2.11</artifactId>
        <version>1.6.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-sql_2.11</artifactId>
        <version>1.6.1</version>
    </dependency>
    <dependency>
        <groupId>com.databricks</groupId>
        <artifactId>spark-csv_2.11</artifactId>
        <version>1.4.0</version>
    </dependency>
    <!-- Test Dependencies -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.scalacheck</groupId>
        <artifactId>scalacheck_2.11</artifactId>
        <version>1.12.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest_2.11</artifactId>
        <version>2.2.6</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.holdenkarau</groupId>
        <artifactId>spark-testing-base_2.11</artifactId>
        <version>1.6.0_0.3.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>ArtimaMavenRepository</id>
        <name>Artima Maven Repository</name>
        <url>http://repo.artima.com/releases/</url>
        <layout>default</layout>
    </repository>
</repositories>

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <reportSets>
                <reportSet>
                    <reports>
                        <report>index</report>
                    </reports>
                </reportSet>
            </reportSets>
        </plugin>

        <plugin>
            <groupId>org.scoverage</groupId>
            <artifactId>scoverage-maven-plugin</artifactId>
            <version>${scoverage.plugin.version}</version>
            <reportSets>
                <reportSet>
                    <reports>
                        <report>report</report> <!-- select only one report from: report, integration-report and report-only reporters -->
                    </reports>
                </reportSet>
            </reportSets>
        </plugin>
    </plugins>
</reporting>

此外,您应该从依赖项中删除 scoverage-pluginscoverage-runtime 工件。 Scoverage 插件将在需要时添加它们。

我在开始使用 scalatest 时遇到了同样的问题。我使用 1.0.6-M2 版本为我解决了错误。 plugins.sbt 中的以下 2 行起到了作用

resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"

addSbtPlugin("com.artima.supersafe" % "sbtplugin" % "1.0.6-M2")