安装sbt-eclipse - 未解析的依赖项:com.typesafe.sbt

时间:2016-01-19 07:50:27

标签: eclipse scala ubuntu sbt

我试图使用these instructions开始使用Lift框架,并且安装sbt-eclipse插件会给我带来麻烦。首先,我在我的Ubuntu 14.04计算机上安装了sbt:

  1. wget http://apt.typesafe.com/repo-deb-build-0002.deb
  2. sudo dpkg -i repo-deb-build-0002.deb
  3. sudo apt-get update
  4. sudo apt-get install sbt
  5. 安装工作正常。然后我去了/home/johnmichaelreed/.sbt/0.13并创建了一个名为" plugins.sbt"的文件。并复制粘贴:

    addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
    

    在我创建该文件之前,我可以运行" sbt"在终端没有错误并退出。但是在添加它之后,我遇到了依赖性问题。

    downloaded Lift 2.6 TAR并在示例app lift_basic中打开了" / project /"和" build.properties"在文件里面我说:

    sbt.version=0.13.7
    addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
    

    当我在lift_basic应用程序文件夹中运行.sbt或" sbt" (没有点),我得到了这个丑陋的信息......

    user@computer:~/Documents/lift-lift_26_sbt-3c4742e/scala_211/lift_basic$ ls
    build.sbt            project  sbt-launch-0.13.8.jar
    console.devmode.log  sbt      src
    lift_proto.db.mv.db  sbt.bat  target
    
    user@computer:~/Documents/lift-lift_26_sbt-3c4742e/scala_211/lift_basic$ ./sbt 
    Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
    [info] Loading project definition from /home/johnmichaelreed/Documents/lift-lift_26_sbt-3c4742e/scala_211/lift_basic/project
    [warn] There may be incompatibilities among your library dependencies.
    [warn] Here are some of the libraries that were evicted:
    [warn]  * com.typesafe.sbteclipse:sbteclipse-plugin:3.0.0 -> 4.0.0
    [warn] Run 'evicted' to see detailed eviction warnings
    [info] Set current project to Lift 2.6 starter template (in build file:/home/johnmichaelreed/Documents/lift-lift_26_sbt-3c4742e/scala_211/lift_basic/)
    [info] Updating {file:/home/johnmichaelreed/Documents/lift-lift_26_sbt-3c4742e/scala_211/lift_basic/}lift_basic...
    [info] Resolving com.typesafe.sbteclipse#sbteclipse-plugin;3.0.0 ...
    [warn]  module not found: com.typesafe.sbteclipse#sbteclipse-plugin;3.0.0
    [warn] ==== local: tried
    [warn]   /home/johnmichaelreed/.ivy2/local/com.typesafe.sbteclipse/sbteclipse-plugin/scala_2.11/sbt_0.13/3.0.0/ivys/ivy.xml
    [warn] ==== public: tried
    [warn]   https://repo1.maven.org/maven2/com/typesafe/sbteclipse/sbteclipse-plugin_2.11_0.13/3.0.0/sbteclipse-plugin-3.0.0.pom
    [warn] ==== snapshots: tried
    [warn]   https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/sbteclipse/sbteclipse-plugin_2.11_0.13/3.0.0/sbteclipse-plugin-3.0.0.pom
    [warn] ==== staging: tried
    [warn]   https://oss.sonatype.org/content/repositories/staging/com/typesafe/sbteclipse/sbteclipse-plugin_2.11_0.13/3.0.0/sbteclipse-plugin-3.0.0.pom
    [warn] ==== releases: tried
    [warn]   https://oss.sonatype.org/content/repositories/releases/com/typesafe/sbteclipse/sbteclipse-plugin_2.11_0.13/3.0.0/sbteclipse-plugin-3.0.0.pom
    [info] Resolving org.eclipse.jetty.orbit#javax.transaction;1.1.1.v201105210645 .[info] Resolving org.eclipse.jetty.orbit#javax.mail.glassfish;1.4.1.v20100508202[info] Resolving org.eclipse.jetty.orbit#javax.activation;1.1.0.v201105071233 ..[info] Resolving jline#jline;2.12.1 ...
    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
    [warn]  ::          UNRESOLVED DEPENDENCIES         ::
    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
    [warn]  :: com.typesafe.sbteclipse#sbteclipse-plugin;3.0.0: not found
    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
    [warn] 
    [warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
    [warn]      com.typesafe.sbteclipse:sbteclipse-plugin:3.0.0 (scalaVersion=2.11, sbtVersion=0.13)
    [warn] 
    [warn]  Note: Unresolved dependencies path:
    [warn]      com.typesafe.sbteclipse:sbteclipse-plugin:3.0.0 (scalaVersion=2.11, sbtVersion=0.13) (/home/johnmichaelreed/.sbt/0.13/plugins.sbt#L1-2)
    [warn]        +- net.liftweb:lift-2-6-starter-template_2.11:0.0.4
    sbt.ResolveException: unresolved dependency: com.typesafe.sbteclipse#sbteclipse-plugin;3.0.0: not found
        at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:278)
        at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:175)
        at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:157)
        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:151)
        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:151)
        at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:128)
        at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:56)
        at sbt.IvySbt$$anon$4.call(Ivy.scala:64)
        at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
        at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
        at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
        at xsbt.boot.Using$.withResource(Using.scala:10)
        at xsbt.boot.Using$.apply(Using.scala:9)
        at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
        at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
        at xsbt.boot.Locks$.apply0(Locks.scala:31)
        at xsbt.boot.Locks$.apply(Locks.scala:28)
        at sbt.IvySbt.withDefaultLogger(Ivy.scala:64)
        at sbt.IvySbt.withIvy(Ivy.scala:123)
        at sbt.IvySbt.withIvy(Ivy.scala:120)
        at sbt.IvySbt$Module.withModule(Ivy.scala:151)
        at sbt.IvyActions$.updateEither(IvyActions.scala:157)
        at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1318)
        at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1315)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$85.apply(Defaults.scala:1345)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$85.apply(Defaults.scala:1343)
        at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1348)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1342)
        at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
        at sbt.Classpaths$.cachedUpdate(Defaults.scala:1360)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1300)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1275)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:235)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    [error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.sbteclipse#sbteclipse-plugin;3.0.0: not found
    Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q
    
    user@computer:~/Documents/lift-lift_26_sbt-3c4742e/scala_211/lift_basic$ ./sbt 
    Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
    [info] Loading project definition from /home/johnmichaelreed/Documents/lift-lift_26_sbt-3c4742e/scala_211/lift_basic/project
    [info] Updating {file:/home/johnmichaelreed/Documents/lift-lift_26_sbt-3c4742e/scala_211/lift_basic/project/}lift_basic-build...
    [info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt-fccfbd44c9f64523b61398a0155784d[info] Resolving org.fusesource.jansi#jansi;1.4 ...
    [info] Done updating.
    [info] Set current project to Lift 2.6 starter template (in build file:/home/johnmichaelreed/Documents/lift-lift_26_sbt-3c4742e/scala_211/lift_basic/)
    [info] Updating {file:/home/johnmichaelreed/Documents/lift-lift_26_sbt-3c4742e/scala_211/lift_basic/}lift_basic...
    [info] Resolving com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0 ...
    [warn]  module not found: com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0
    [warn] ==== local: tried
    [warn]   /home/johnmichaelreed/.ivy2/local/com.typesafe.sbteclipse/sbteclipse-plugin/scala_2.11/sbt_0.13/4.0.0/ivys/ivy.xml
    [warn] ==== public: tried
    [warn]   https://repo1.maven.org/maven2/com/typesafe/sbteclipse/sbteclipse-plugin_2.11_0.13/4.0.0/sbteclipse-plugin-4.0.0.pom
    [warn] ==== snapshots: tried
    [warn]   https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/sbteclipse/sbteclipse-plugin_2.11_0.13/4.0.0/sbteclipse-plugin-4.0.0.pom
    [warn] ==== staging: tried
    [warn]   https://oss.sonatype.org/content/repositories/staging/com/typesafe/sbteclipse/sbteclipse-plugin_2.11_0.13/4.0.0/sbteclipse-plugin-4.0.0.pom
    [warn] ==== releases: tried
    [warn]   https://oss.sonatype.org/content/repositories/releases/com/typesafe/sbteclipse/sbteclipse-plugin_2.11_0.13/4.0.0/sbteclipse-plugin-4.0.0.pom
    [info] Resolving org.eclipse.jetty.orbit#javax.transaction;1.1.1.v201105210645 .[info] Resolving org.eclipse.jetty.orbit#javax.mail.glassfish;1.4.1.v20100508202[info] Resolving org.eclipse.jetty.orbit#javax.activation;1.1.0.v201105071233 ..[info] Resolving jline#jline;2.12.1 ...
    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
    [warn]  ::          UNRESOLVED DEPENDENCIES         ::
    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
    [warn]  :: com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0: not found
    [warn]  ::::::::::::::::::::::::::::::::::::::::::::::
    [warn] 
    [warn]  Note: Some unresolved dependencies have extra attributes.  Check that these dependencies exist with the requested attributes.
    [warn]      com.typesafe.sbteclipse:sbteclipse-plugin:4.0.0 (scalaVersion=2.11, sbtVersion=0.13)
    [warn] 
    [warn]  Note: Unresolved dependencies path:
    [warn]      com.typesafe.sbteclipse:sbteclipse-plugin:4.0.0 (scalaVersion=2.11, sbtVersion=0.13) (/home/johnmichaelreed/.sbt/0.13/plugins.sbt#L1-2)
    [warn]        +- net.liftweb:lift-2-6-starter-template_2.11:0.0.4
    sbt.ResolveException: unresolved dependency: com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0: not found
        at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:278)
        at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:175)
        at sbt.IvyActions$$anonfun$updateEither$1.apply(IvyActions.scala:157)
        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:151)
        at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:151)
        at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:128)
        at sbt.IvySbt.sbt$IvySbt$$action$1(Ivy.scala:56)
        at sbt.IvySbt$$anon$4.call(Ivy.scala:64)
        at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:93)
        at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:78)
        at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:97)
        at xsbt.boot.Using$.withResource(Using.scala:10)
        at xsbt.boot.Using$.apply(Using.scala:9)
        at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:58)
        at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:48)
        at xsbt.boot.Locks$.apply0(Locks.scala:31)
        at xsbt.boot.Locks$.apply(Locks.scala:28)
        at sbt.IvySbt.withDefaultLogger(Ivy.scala:64)
        at sbt.IvySbt.withIvy(Ivy.scala:123)
        at sbt.IvySbt.withIvy(Ivy.scala:120)
        at sbt.IvySbt$Module.withModule(Ivy.scala:151)
        at sbt.IvyActions$.updateEither(IvyActions.scala:157)
        at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1318)
        at sbt.Classpaths$$anonfun$sbt$Classpaths$$work$1$1.apply(Defaults.scala:1315)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$85.apply(Defaults.scala:1345)
        at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$85.apply(Defaults.scala:1343)
        at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1348)
        at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:1342)
        at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
        at sbt.Classpaths$.cachedUpdate(Defaults.scala:1360)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1300)
        at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1275)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:235)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
    [error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0: not found
    Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? 
    

    然后我再试一次......

    user@computer:~/Desktop/sbt_home$ sbt eclipse
    Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384m; support was removed in 8.0
    error: error while loading CharSequence, class file '/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar(java/lang/CharSequence.class)' is broken
    (bad constant pool tag 18 at byte 10)
    [error] Type error in expression
    Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? i
    [warn] Ignoring load failure: no project loaded.
    [error] Not a valid command: eclipse (similar: help, alias)
    [error] eclipse
    [error]        ^
    user@computer:~/Desktop/sbt_home$
    

    如何使我的Lift Eclipse sbt-project工作?

2 个答案:

答案 0 :(得分:0)

你必须为此添加一个解析器: 尝试使用

    resolvers ++= Seq(
 "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
)

resolvers += Resolver.sonatypeRepo("releases")

它对我有用。

答案 1 :(得分:0)

  1. 在控制台中,我看到sbt试图拉出两个版本的sbt-eclipse。请确保您只使用版本,请检查:

    plugins/plugin.sbt
    plugins/project/plugin.sbt
    PROJECT_DIR/plugin.sbt
    
  2. 为简单起见,您只能使用一个plugin.sbt(../plugins /plugin.sbt)并删除其他内容。

    com.typesafe.sbteclipse#sbteclipse-plugin;3.0.0: not found
    

    com.typesafe.sbteclipse#sbteclipse-plugin;4.0.0: not found
    
    1. 确保您的sbt-eclipse版本与您机器中的scala和sbt版本兼容。


      例如:sbt-eclipse verion 4.0.0兼容(scalaVersion = 2.11,sbtVersion = 0.13)。