Skip to content
标签
欢迎扫码关注公众号

Sbt 添加 assembly 命令

通过 sbt package 命令打的包是不包含 compile scope 的包的,若要包含的话需要使用 sbt assembly 命令。

sbt 默认不包含该命令,需要添加 sbt-assembly 插件。

但在添加插件的过程中遇到了如下错误:

[error] sbt.librarymanagement.ResolveException: Error downloading com.eed3si9n:sbt-assembly;sbtVersion=1.0;scalaVersion=2.12:0.14.4

scalaVersion 版本是 2.12.10sbt-assembly 小于/等于 0.14.4 时就会报这个错误。
(当前 sbt-assembly 的最新版是 0.14.10

在项目根目录的 project 子目录下创建 plugins.sbt 文件(文件名貌似无所谓,只要是 project 目录下的 .sbt 后缀的文件就行)。
其内容如下:

java
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")

之后就可以使用 sbt assembly 命令打包项目了。
打包后的 jar 包保存在 \target\scala-2.12\sbt-1.0 目录下。

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.