且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将SQLite数据库打包到jar中?

更新时间:2023-02-02 18:16:19

AFAIK你不能在没有太多麻烦的情况下修改jar内的资源(基本上它是一个zip,因此它应该是可能的,但可能有由JVM等文件锁定。)。

AFAIK you can't modify resources inside a jar without much hassle (basically it is a zip and thus it should be possible, but there might be file locks by the JVM etc.).

此外,你不能把一个jar放到另一个jar中。但是,如果需要,可以解压缩驱动程序jar并将内容包含在jar中。 Maven程序集插件的目标是这样做: jar-with-dependencies

Additionally, you can't put one jar into another. However, you could unpackage the driver jar and include the contents in your jar, if you want that. The Maven assembly plugin has a goal that does this: jar-with-dependencies.