Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 maven-assembly-plugin 构建一个胖罐。jar 生成成功。我对我的项目的唯一依赖是:JUnit。但是在胖罐子里,我看不到这个(使用 jar tf 命令)。JUnit 依赖项通常不包含在 fat jar 中吗?
junit 通常是一个test作用域的依赖,然后就不会被包含进来。
test
具有范围的依赖项test旨在在构建期间用于测试,因此无需将它们包含在最终 JAR 中。
如果由于某种原因,最终 JAR 中需要 junit,则需要将范围更改为compile.
compile