批处理 Java 帮助
我的公司正在尝试确定实现批处理 Java 程序的最佳策略。我们有几百个(并且还在不断增长)独立的 Java 程序。其中大多数是单独的 Jasper 报告,但也有一些是较大的批量 Java 作业。目前,每个 Java 项目都使用 Eclipse 的导出选项打包为一个独立的 JAR 文件。然后,这些 JAR 会手动部署到我们的 Linux 服务器上并进行测试。如果它们通过了测试,就会通过 QA 向上迁移,并通过本地源代码控制系统迁移到生产环境。
这是执行批处理 Java 的最佳策略吗?持续的维护可能会很麻烦,因为搜索 Jar 文件并不容易,而且不同的开发人员每周都会创建新的 Java 项目(新报告)。
将现有项目从 Jar 文件导入 Eclipse 也是一个棘手的过程。我们希望这些事情变得更容易。我们考虑过将所有代码打包到 1 个大项目中,并编写一个接口,以便能够使用 Web 服务器执行所需的“包”(也称为程序)。
其他人/公司正在用他们的批处理 Java 程序做什么?在这方面有什么最佳实践吗?任何帮助/想法/工作模型将不胜感激。
My company is trying to determine the best strategy for implementing batch Java programs. We have a few hundred (and growing) separate Java programs. Most of them are individual Jasper Reports but some are bigger batch Java jobs. Currently, each Java Project is packaged an independent JAR file using Eclipse's export option. Those JARs are then deployed to our Linux server manually where they are tested. If they pass testing, they are then migrated up through QA and onto Production through a home grown source code control system.
Is this the best strategy for doing batch Java? Ongoing maintenance can be a hassle since searching Jar files is not easy and different developers are creating new Java Projects (new reports) every week.
Importing existing projects from the Jar files into Eclipse is a tricky process as well. We would like these things to be easier. We have thought about packaging all the code into 1 big project and writing an interface to be able to execute the desired "package" (aka program) maybe using a Web Server.
What are other people/companies doing out there with their batch Java programs? Are there any best practices out there on this stuff? Any help/ideas/working models would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想说,您应该能够创建一个基于 Web 的应用程序来访问 Jasper 报告,而不是一堆批处理过程。然后,当您需要部署新报告时,只需部署一个小更新即可访问新编译的 Jasper 报告文件。
也就是说,您应该将代码而不是二进制文件检查到 Subversion 或 Git 存储库中。转储“自制”源代码控制存储库。生命太短暂,无法尝试在家种植这样的东西。只需使用 Git 或 Subversion,它们经过验证、简单且实用。当您导入新项目时,只需从 Subversion 中将其拉下来,不要尝试从 Eclipse IDE 导入 JAR 文件。
将 JAR 文件放入 Maven 存储库(例如 Nexus),然后从那里部署到 QA 和生产。为每个项目创建自动化构建(无论是使用 Maven 还是其他项目)。不要依赖 IDE 来导出 JAR 文件。 IDE 的更改以及从 IDE 的导出会带来更多人为错误的机会。此外,不同的开发人员会喜欢不同的 IDE。通过对 Maven 之类的东西进行标准化,您可以更加不受 IDE 的影响。
I would say that you should be able to create one web based app for access Jasper reports, rather than a bunch of batch processes. Then, when you need to deploy a new report, just deploy a minor update that accesses a new compiled Jasper report file.
That said, you should be checking your code, not your binaries, into a Subversion or Git repository. Dump the "home grown" source control repository. Life is too short to try to home grow stuff like that. Just use Git or Subversion, they're proven, simple, and functional. When you import a new project, just pull it down from Subversion, don't try to import the JAR file from your Eclipse IDE.
Put your JAR files into a Maven repository such as Nexus, and deploy to QA and Production from there. Create automated builds for every project (be that with Maven or something else). Don't depend upon an IDE to export your JAR files. IDE's change and exporting from an IDE introduces more opportunity for human error. Also, different developers will prefer different IDE's. By standardizing on something like Maven, you're a bit more IDE agnostic.
Mhy 公司使用 IBM Websphere Extended Deployment 标准化了 Java Batch 执行。
这里 http://www.ibm.com/developerworks/websphere/techjournal/ 0801_vignola/0801_vignola.html是一篇介绍java批处理编程和部署技术的文章。
但即使您对该产品不感兴趣,这篇文章仍然是必读的。
Mhy company has standardized Java Batch execution using IBM Websphere Extended Deployment.
Here http://www.ibm.com/developerworks/websphere/techjournal/0801_vignola/0801_vignola.html is an article introducing techniques for programming and deploying java batch.
But even if you are not interested in the product, the article is a must read anyway.