在存档文件中包含源代码

发布于 2024-08-17 06:43:33 字数 106 浏览 5 评论 0原文

我正在考虑将源代码包含在我的存档文件(EAR、JAR、WAR)中,以便我们可以看到部署的应用程序是什么样子的。 这显然会让档案变得更大。归档文件的大小是否会影响应用程序服务器的性能?这是个好主意吗?

I was considering including the source code in my archive file (EAR, JAR, WAR) so we could see what the deployed application looks like.
This will obviously make the archive much bigger. Does the size of the archive file affect performance on the application server at all? Is this a good idea or not?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

薔薇婲 2024-08-24 06:43:33

这是解决您的问题的另一个解决方案,可以代替(将源代码放入 .jar 中)或作为补充:指定 .jar 的源代码管理修订版 id。您可以在清单文件或属性文件中指定它。

源代码管理修订 ID 是与源代码控制系统上的项目根关联的当前 ID。它可以在 SVN、Git 和大多数现代源代码控制系统中轻松使用。在旧系统 (CVS) 中,您必须首先使用当前日期和时间创建一个(命名)标签(以确保唯一性)。修订号将允许您从源代码控制中检索从中获取存档的确切快照,因此当您修复错误时,您将在正确的源上修复它们。

这种技术将允许您节省空间 - 您不需要传送整个源目录。

但是,即使源包含在存档中,指定此数字仍然是一个好主意,因为它一致指定了创建存档的历史点。手动将存档中的源代码与源代码管理中的源代码进行比较是一件痛苦的事情。

Here's another solution to your problem which can come instead (of putting the sources in the .jar) or in addition to it: Specify the source control revision id to the .jar. You can specify it in the manifest file or in a properties file.

The source control revision id is the current id associated with the root of your project on the source control system. It is readily available in SVN, Git and most modern source control systems. In older systems (CVS) you must first create a (named) tag probably by using current date and time (to ensure uniqueness). The revision number will let you to retrieve from the source control the exact snapshot from which the archive was obtained, so when you fix bugs you'll be fixing them on the correct sources.

This technique will allow you to save space - you won't need to ship the whole source directory.

However, it is still a good idea to specify this number even if the sources are included in the archive simply because it unanimously specifies the point in history where the archive was created. Manually comparing the sources in the archive with those in the source control is a pain.

半窗疏影 2024-08-24 06:43:33

它确实会影响性能,因为存档索引中有更多条目,但这不会太糟糕,您将把源代码放在它自己的子目录中。或者,您可以创建一个源存档并将其与其他文件一起铲除。那将是我的选择。当然,如果这是 GPL 发行版,您必须明确说明源代码所在的位置。

It does affect the performance to the extent that there are more entries in the archive's index but that won't be too bad and you'll put the source in its own subdirectory. Or you can just make a source archive and shovel it around with the other files. That would be my choice. Of course if this is a GPL distribution, you'll have to be explicit about where the source is located.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文