我创建了一个简单的 Maven 项目(包装类型 - Jar),它依赖于 Spring 和 My Sql 库(mysql-connector)。当我打包这个项目时,$mvn package
我在成功执行这个命令后得到了一个 jar 文件。
我还试图在输出 jar 文件中包含所有依赖项,所以我添加了一个“jar-with-dependencies”程序集描述符,但正如文档所述:
The `jar-with-dependencies` descriptor builds a JAR archive with the contents of the main project jar along with the unpacked contents of all the project’s runtime dependencies.
我想在JAR
形式中包含依赖项,而不是unpacked
方式。我怎样才能做到这一点?