ElasticSearch Shield Maven dependency to SBT dependency

I have the following dependency in Maven:

 <repositories>
  <!-- add the elasticsearch repo -->
  <repository>
     <id>elasticsearch-releases</id>
     <url>https://maven.elasticsearch.org/releases</url>
     <releases>
        <enabled>true</enabled>
     </releases>
     <snapshots>
        <enabled>false</enabled>
     </snapshots>
  </repository>
</repositories>

<dependencies>
  <!-- add the shield jar as a dependency -->
  <dependency>
     <groupId>org.elasticsearch.plugin</groupId>
     <artifactId>shield</artifactId>
     <version>2.0.1</version>
  </dependency>
</dependencies>

Is there a way to translate it to SBT format?

I tried:

resolvers += "elasticsearch-releases" at "https://maven.elasticsearch.org/releases"
libraryDependencies += "org.elasticsearch.plugin" %% "shield" % "2.0.1"

But it failed to find this artifact.

Answers


When you use the %% identifier, it appends the Scala version to the name of the artifact. Quoting the documentation:

If you use groupID %% artifactID % revision rather than groupID % artifactID % revision (the difference is the double %% after the groupID), sbt will add your project’s Scala version to the artifact name. This is just a shortcut.

This is not the case here so you should use the single %:

resolvers += "elasticsearch-releases" at "https://maven.elasticsearch.org/releases"
libraryDependencies += "org.elasticsearch.plugin" % "shield" % "2.0.1"

So I managed to do it by defining the dependency explicitly.

libraryDependencies +=
"org.elasticsearch.plugin" %% "shield" % "2.0.1" from "https://maven.elasticsearch.org/releases/org/elasticsearch/plugin/shield/2.0.1/shield-2.0.1.jar"

Need Your Help

Running a WCF service before unit testing

c# wcf unit-testing

I have a VS 2010 solution that contains two projects: the first is a WCF service, and the second is a unit testing project, holding a reference to the service and testing the methods the service is

XSockets and Asp.Net 4.0 Website Project

c# asp.net xsockets.net

Can anybody give me a working example of an ASP dot net 4.0 website project that has a working implementation of XSockets in it?