sbt,publishLocal,解决错误

时间:2016-05-16 09:12:13

标签: scala sbt ivy publishing

我想将我的工件推送到本地ivy存储库,以便将它们用作其他项目中的依赖项。

我的神器的build.scala:

> update
[info] Updating {file:/home/user256/Projects/apiAdmin/back/}apiAdmin...
[info] Resolving jline#jline;2.12.1 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.github.kondaurovdev#jsonapi_2.11;0.1-SNAPSHOT: java.text.ParseException: [unknown tag project in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag modelVersion in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag groupId in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag artifactId in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag packaging in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag description in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag version in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag name in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag organization in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag name in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag url in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag licenses in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag license in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag name in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag url in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag distribution in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag scm in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag url in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag connection in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag developers in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag developer in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag id in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag name in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] , unknown tag url in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[warn] ]
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]          com.github.kondaurovdev:jsonapi_2.11:0.1-SNAPSHOT (/home/user256/Projects/apiAdmin/back/build.sbt#L7)
[warn]            +- com.github.kondaurovdev:apiadmin_2.11:0.1-SNAPSHOT
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.github.kondaurovdev#jsonapi_2.11;0.1-SNAPSHOT: java.text.ParseException: [unknown tag project in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag modelVersion in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag groupId in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag artifactId in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag packaging in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag description in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag version in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag name in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag organization in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag name in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag url in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag licenses in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag license in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag name in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag url in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag distribution in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag scm in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag url in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag connection in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag developers in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag developer in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag id in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag name in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] , unknown tag url in file:/home/user256/.ivy2/cache/com.github.kondaurovdev/jsonapi_2.11/ivy-0.1-SNAPSHOT.xml.original
[error] ]
[error] Total time: 2 s, completed May 16, 2016 12:12:14 PM

运行publishLocal任务:

function confirm(){
    var begin= document.getElementById("decision");
    if(begin.value == "yes") {
        console.log("Success!");
    }
    else {
        console.log("Failure");
    }
}

似乎一切正常,但是当我在依赖于该工件的项目中运行更新任务时,我会遇到一些错误:

std::rethrow_exception(e);

有什么问题?

2 个答案:

答案 0 :(得分:5)

我从〜。/。ivy2 / cache中删除了com.github.kondaurovdev并再次运行更新任务:

> update
[info] Updating {file:/home/user256/Projects/apiAdmin/back/}apiAdmin...
[info] Resolving com.github.kondaurovdev#jsonapi_2.11;0.1-SNAPSHOT ...
[warn] Choosing local for com.github.kondaurovdev#jsonapi_2.11;0.1-SNAPSHOT
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.

好像没关系

答案 1 :(得分:0)

它被提出作为反对sbt的问题。 https://github.com/sbt/sbt/issues/1824

正如您所发现的,您可以从.ivy缓存中删除受影响的目录。