Could not find artifact org.mongodb:casbah_2.10:jar:2.7.0-RC1 in oss-sonatype (https://oss.sonatype.org/content/repositories/releases/)

 

Problem 1

When including casbah via maven:

<dependency>
    <groupId>org.mongodb</groupId>
    <artifactId>casbah_2.10</artifactId>
    <version>2.7.0-RC1</version>
    <type>pom</type>    
</dependency>

get the following error:

[ERROR] Failed to execute goal on project ... : Could not resolve dependencies for project ... : Could not find artifact org.mongodb:casbah_2.10:jar:2.7.0-RC1 in oss-sonatype (https

Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact org.mongodb:casbah_2.10:jar:2.7.0-RC1 in oss-sonatype (https://oss.sonatype.org/content/repositories/releases/)

Solution

Need to specify pom type explicitly:

<dependency>
<groupId>org.mongodb</groupId>
<artifactId>casbah_2.10</artifactId>
<version>2.7.0-RC1</version>
<type>pom</type>
</dependency>

Also need to add repo:

    <repositories>
        <repository>
            <id>oss-sonatype</id>
            <name>oss-sonatype</name>
            <url>https://oss.sonatype.org/content/repositories/releases/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>

    </repositories>

 

NOTE: You may need to flash out old dependencies by

mvn clean install -U -X

Problem 2

In the beginning I was actually trying to include the sbt project into maven project; by adding to build.sbt:

publishTo := Some(Resolver.file("file",  new File(Path.userHome.absolutePath+"/.m2/repository")))

Everything was building fine (with “sbt publish”); but when I was trying to include the project in maven it would give the same error as in (Problem 1).

After a lot of digging around; the solution was to explicitly use pomOnly mode for the casbah dependency in build.sbt:

libraryDependencies += “org.mongodb” %% “casbah” % “2.7.0-RC1”pomOnly()

 

 

keywords

maven sbt casbah error mongo mongodb

Searched for casbah maven 7:05am
  Maven Repository: org.mongodb » casbah-core_… – mvnrepository.com
Searched for maven clean cache 6:50pm
  Force maven update – Stack Overflow – stackoverflow.com 6:50pm
earched for mongo casbah maven sonatype 6:48pm
Searched for maven add sonatype repository 6:33pm
  robolectric – How do you import a Maven… – stackoverflow.com 6:34pm
Searched for org.mongodb:casbah maven 6:29pm
  Casbah Maven dependency FAILS in Eclipse… – stackoverflow.com 6:30pm
Searched for maven Failure to find org.mongodb:casbah_2.10 6:28pm
  Scala Casbah MongoDB driver – Maven error… – stackoverflow.com 6:28pm
  2.3. Alternative installation methods… – github.io – Viewed 5 times 6:29pm
Searched for mongo casbah maven 6:21pm
  Maven Repository: org.mongodb » casbah-core_… – mvnrepository.com
Searched for maven force update command line 1:16pm
  Maven: Command to update repository after… – stackoverflow.com 1:16pm
Searched for org.mongodb:casbah_2.10 1:13pm
  Maven Repository: org.mongodb » casbah_2.10 – mvnrepository.com 1:14pm
Searched for sbt deploy to maven repository 12:47pm
  Publishing — sbt Documentation – scala-sbt.org 12:47pm
Searched for maven use artifact from ivy 12:45pm
  Publishing multiple artifacts to maven… – stackoverflow.com 12:46pm
  How to download artifacts from ivy repository… – stackoverflow.com 12:46pm
Searched for maven using sbt 12:44pm
  shivawu/sbt-maven-plugin · GitHub – github.com
Searched for how to sbt to be usable by maven 12:44pm
Searched for maven use local ivy 12:41pm
  How to make Maven use an ivy repository… – stackoverflow.com 12:42pm
  How to use the ivy local repository as… – stackoverflow.com 12:42pm
Searched for maven use sbt publish-local 12:40pm
Searched for maven sbt publish-local 12:39pm
  maven – Publish SBT project to local… – stackoverflow.com 12:40pm
Searched for sbt publish local maven 12:38pm
  Publishing — sbt Documentation – scala-sbt.org 12:38pm
Searched for sbt organization 12:35pm
  Naming the Scala build file — sbt Documentation – scala-sbt.org 12:36pm
Searched for maven scala version 12:33pm
  Maven Repository: org.scala-tools »… – mvnrepository.com 12:33pm

 

 

 

 

About Neil Rubens

see http://ActiveIntelligence.org

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*