sbt assembly command not found

后端 未结 6 1657
忘掉有多难
忘掉有多难 2021-01-01 09:03

I\'m trying to run sbt assembly. According to https://github.com/sbt/sbt-assembly , for sbt 0.13.6+ (I\'m on 0.13.7) this should be included automatically for anything with

相关标签:
6条回答
  • 2021-01-01 09:44
    lazy val root = (project in file(".")).
      settings(commonSettings: _*).
      settings(
        assemblySettings ++ Seq(
        jarName in assembly := "roobricks-spark.jar",
        test in assembly := {}
      ).
      enablePlugins(AssemblyPlugin)
    

    can you once with this.

    0 讨论(0)
  • 2021-01-01 09:45

    Same thing happened to me. Move assembly.sbt from the root to inside your project/ directory

    0 讨论(0)
  • 2021-01-01 09:51

    From sparkour:

    addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.4") with assembly.plugin does work

    0 讨论(0)
  • 2021-01-01 09:56

    Did you create a assembly.sbt at the root of your project? Alongside your build.sbt?

    If so, then that's the problem. You want to have it inside the project directory.

    Having done that it worked out the box as expected with the rest of your setup:

    > assembly
    [info] Including: scala-library.jar
    [info] Checking every *.class/*.jar file's SHA-1.
    [info] Merging files...
    [warn] Merging 'META-INF/MANIFEST.MF' with strategy 'discard'
    [warn] Strategy 'discard' was applied to a file
    [info] SHA-1: 1ae0d7a9c433e439e81ce947659bf05aa62a2892
    [info] Packaging /Users/dnw/Desktop/t-2015-04-08.2340/target/scala-2.10/test-assembly-1.0.jar ...
    [info] Done packaging.
    [success] Total time: 2 s, completed 08-Apr-2015 23:45:59
    
    0 讨论(0)
  • 2021-01-01 09:57

    Since the introduction of auto plugins in 0.13.5, adding explicit .sbt files for plugins (except for specific cases where the plugin does not implement auto-plugin trait) is not recommended per sbt documentation.

    Add the addSbtPlugin("com.eed3si8n" % "sbt-assembly" % "0.13.0") back to plugins.sbt under project directory and remove assembly.sbt. if you still see the error, explicitly enable the plugin in the build.sbt:

    lazy val root = (project in file(".")).
      settings(commonSettings: _*).
      settings(
        name := "test",
      ).
      enablePlugins(AssemblyPlugin)
    
    0 讨论(0)
  • 2021-01-01 09:59

    Came across the same error. The reason was I executing it from the wrong inside target folder

    0 讨论(0)
提交回复
热议问题