-1
這是在本地使用sbt publish-local
發佈我的FAT瓶當地SBT回購
現在我引用這是另一個項目build.sbt
name := "Slick2Test"
version := "1.0"
scalaVersion := "2.11.8"
libraryDependencies ++= Seq(
"mysql" % "mysql-connector-java" % "5.1.36",
"com.typesafe.slick" % "slick_2.11" % "2.1.0",
"com.foo" %% "Slick3Test2" % "1.2"
)
我build.sbt文件
lazy val myproject = (project in file(".")).settings(
name := "Slick3Test2",
organization := "com.foo",
version := "1.2",
scalaVersion := "2.11.8",
libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % "3.2.0"
),
assemblyShadeRules in assembly := Seq(
ShadeRule.rename("slick.**" -> "[email protected]").inAll
),
artifact in (Compile, assembly) := {
val art = (artifact in (Compile, assembly)).value
art.copy(`classifier` = Some("assembly"))
},
addArtifact(artifact in (Compile, assembly), assembly)
)
我出版這
但是我得到一個錯誤
[info] Resolving jline#jline;2.12.1 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.foo#Slick3Test2_2.11;1.2: java.text.ParseException: inconsistent module descriptor file found in '/Users/foo/.ivy2/local/com.foo/Slick3Test2_2.11/1.2/ivys/ivy.xml': bad module name: expected='Slick3Test2_2.11' found='slick3test2_2.11';
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] com.abhi:Slick3Test2_2.11:1.2 (/Users/foo/IdeaProjects/Slick2Test/build.sbt#L7-12)
[warn] +- default:slick2test_2.11:1.0
[trace] Stack trace suppressed: run 'last *:ssExtractProject' for the full output.
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[error] (*:ssExtractProject) sbt.ResolveException: unresolved dependency: com.foo#Slick3Test2_2.11;1.2: java.text.ParseException: inconsistent module descriptor file found in '/Users/foo/.ivy2/local/com.foo/Slick3Test2_2.11/1.2/ivys/ivy.xml': bad module name: expected='Slick3Test2_2.11' found='slick3test2_2.11';
[error] (*:update) sbt.ResolveException: unresolved dependency: com.foo#Slick3Test2_2.11;1.2: java.text.ParseException: inconsistent module descripto
根據maven命名約定,artifactId應該是小寫的。你有沒有嘗試過使用'artifactName'與'name'不同(http://www.scala-sbt.org/0.13.5/docs/Detailed-Topics/Artifacts.html),或者使'name'小一點? – red1ynx