How to upload a native scala project to local repo by sbt like using "maven install"

40 Views Asked by At

I'm learning akka by reading Learning Akka .The package manager recommended is sbt, but I have a problem with it.

I write a project,a key:value nosql memory database server demo, whose package manager is sbt and its build.sbt is as follwing:

name := "akkademy-db-scala"

organization := "com.akkademy-db"

version := "0.0.1-SNAPSHOT"

scalaVersion := "2.11.12"

libraryDependencies ++= Seq(
  "com.typesafe.akka" %% "akka-agent" % "2.3.6",
  "com.typesafe.akka" %% "akka-actor" % "2.3.6",
  "com.typesafe.akka" %% "akka-remote" % "2.3.6",
  "com.typesafe.akka" %% "akka-testkit" % "2.3.6" % "test",
  "org.scalatest" %% "scalatest" % "2.1.6" % "test"
)

mappings in (Compile, packageBin) ~= { _.filterNot { case (_, name) =>
  Seq("application.conf").contains(name)
}}

And then I write another project, a database client demo, whitch referencd the project above, and its build.sbt is as following:

name := """akkademy-db-client-scala"""

version := "1.0"

scalaVersion := "2.11.12"

// Change this to another test framework if you prefer
libraryDependencies ++= Seq(
  "com.akkademy-db"   %% "akkademy-db-scala" % "0.0.1-SNAPSHOT",
  "org.scalatest" %% "scalatest" % "2.2.4" % "test"
)

Here, "com.akkademy-db" %% "akkademy-db-scala" % "0.0.1-SNAPSHOT" point at that projcet, but something wrong happend when the project being imported to IDEA.

[error] stack trace is suppressed; run 'last update' for the full output
[error] stack trace is suppressed; run 'last ssExtractDependencies' for the full output
[error] (update) sbt.librarymanagement.ResolveException: Error downloading com.akkademy-db:akkademy-db-scala_2.11:0.0.1-SNAPSHOT
[error]   Not found
[error]   Not found
[error]   not found: C:\Users\yxmak\.ivy2\localcom.akkademy-db\akkademy-db-scala_2.11\0.0.1-SNAPSHOT\ivys\ivy.xml
[error]   not found: https://repo1.maven.org/maven2/com/akkademy-db/akkademy-db-scala_2.11/0.0.1-SNAPSHOT/akkademy-db-scala_2.11-0.0.1-SNAPSHOT.pom
[error] (ssExtractDependencies) sbt.librarymanagement.ResolveException: Error downloading com.akkademy-db:akkademy-db-scala_2.11:0.0.1-SNAPSHOT
[error]   Not found
[error]   Not found
[error]   not found: C:\Users\yxmak\.ivy2\localcom.akkademy-db\akkademy-db-scala_2.11\0.0.1-SNAPSHOT\ivys\ivy.xml
[error]   not found: https://repo1.maven.org/maven2/com/akkademy-db/akkademy-db-scala_2.11/0.0.1-SNAPSHOT/akkademy-db-scala_2.11-0.0.1-SNAPSHOT.pom

It seems that sbt can't found the referenced project in local library.

How should I upload my project to local libarary by sbt? In maven, it is "maven install", and other maven project can reference the installed jar. Is there any way to "install" my scala project managed by sbt?

0

There are 0 best solutions below