0

我正在尝试在 Eclipse Scala-IDE Maven 项目中使用 Casbah - MonfoDB 的 Scala 工具包。Maven 在 Casbah 依赖项中失败,并出现以下错误:

Missing artifact com.mongodb.casbah:casbah_2.10.0:pom:2.5.0 pom.xml 

请帮助解决这个问题。这个神器有什么问题?为什么这个神器不见了?我是否应该添加 Casbah 本身所依赖的依赖项,例如 MongoDB Java 驱动程序?我的 pom.xml:

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>test</groupId>
  <artifactId>scalamongo</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>${project.artifactId}</name>
  <description>My wonderfull scala app</description>
  <inceptionYear>2010</inceptionYear>
  <licenses>
<license>
  <name>My License</name>
  <url>http://....</url>
  <distribution>repo</distribution>
</license>
  </licenses>

  <properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<encoding>UTF-8</encoding>
<scala.tools.version>2.10</scala.tools.version>
<scala.version>2.10.0</scala.version>
  </properties>

  <dependencies>
 <dependency>
  <groupId>com.mongodb.casbah</groupId>
  <artifactId>casbah_2.10.0</artifactId>
  <version>2.5.0</version>
  <scope>compile</scope>
  <type>pom</type>
</dependency>
<dependency>
  <groupId>org.scala-lang</groupId>
  <artifactId>scala-library</artifactId>
  <version>${scala.version}</version>
</dependency>

<!-- Test -->
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.11</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.specs2</groupId>
  <artifactId>specs2_${scala.tools.version}</artifactId>
  <version>1.13</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.scalatest</groupId>
  <artifactId>scalatest_${scala.tools.version}</artifactId>
  <version>2.0.M6-SNAP8</version>
  <scope>test</scope>
</dependency>
  </dependencies>

  <build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
  <plugin>
    <!-- see http://davidb.github.com/scala-maven-plugin -->
    <groupId>net.alchim31.maven</groupId>
    <artifactId>scala-maven-plugin</artifactId>
    <version>3.1.3</version>
    <executions>
      <execution>
    <goals>
      <goal>compile</goal>
      <goal>testCompile</goal>
    </goals>
    <configuration>
      <args>
        <arg>-make:transitive</arg>
        <arg>-dependencyfile</arg>
        <arg>${project.build.directory}/.scala_dependencies</arg>
      </args>
    </configuration>
      </execution>
    </executions>
  </plugin>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.13</version>
    <configuration>
      <useFile>false</useFile>
      <disableXmlReport>true</disableXmlReport>
      <!-- If you have classpath issue like NoDefClassError,... -->
      <!-- useManifestOnlyJar>false</useManifestOnlyJar -->
      <includes>
    <include>**/*Test.*</include>
    <include>**/*Suite.*</include>
      </includes>
    </configuration>
  </plugin>
</plugins>
  </build>
</project>
4

1 回答 1

0

刚刚发现以下依赖项适用于 Casbah:

 <dependency>
    <groupId>org.mongodb</groupId>
     <artifactId>casbah-core_2.10</artifactId>
     <version>2.5.0</version>
 </dependency>
于 2013-03-20T23:57:08.897 回答