问题-远程热部署、多模块Maven项目
我知道这里有很多信息......但可能还有其他人遇到这样的问题,我认为讨论这个问题会有很大帮助,或者至少得到一些不错的意见/建议。
好吧,让我首先概述一下我们的环境。
我们有一个多模块 Maven 项目,包含大约 11 个 JAR。依赖于这些内部 JAR 的是 9 个 WAR 文件,其中 8 个放置在 EAR 文件中。剩余的 WAR 文件作为单独的应用程序单独部署。当构建 8 个 WAR 文件(驻留在 EAR 中)时,它们将构建为瘦 WAR 文件,因此生成的 EAR 文件具有最小大小,并且所有依赖项都位于 APP-INF/lib 部分中。所有这些都没有问题。我们当前部署到具有大量内存和 CPU 的远程 WebLogic 10.3 服务器,因此负载不在我们的个人计算机上。我们还使用持续集成构建服务器发布夜间快照。
我们正在部署的工件:
包含 8 个 WAR 文件、11 个内部 JAR 和第三方库的 EAR 文件:~70MB
其他 WAR 文件:~110MB
我们的一些软件工程师希望通过 VPN 连接在家工作,并拥有增量/热部署选项。否则,由于我们如何使用 Web 逻辑/maven 进行部署,他们被迫构建整个 EAR 文件或 110MB WAR 文件并通过 VPN 上传它们。这并不有趣,而且速度也不快。我一直在阅读JRebel,并且想知道是否还有其他人将 JRebel 与多模块 Maven 项目一起使用来进行远程部署,以及如何有效地进行部署。
根据我的一些阅读,建议将更改“上传”到服务器,并让rebel.xml 配置读取特定部署的这些目录,这……好吧,让我们遇到了手头的问题。我如何告诉 Maven 将更改的资源/新编译的类文件转储到其他目录,以便我可以将它们上传到服务器和适当的文件夹(我们的服务器托管在不同端口上运行的 10 多个 WebLogic 实例,每个实例一个实例)开发商)。或者只是让开发人员与网络共享他们的工作区文件夹,并配置rebel.xml 文件(例如在JAR 中)指向相应的//COMPUTERNAME/workspace/jarProjectName/target/classes 文件夹。我预见到的问题是,每次他们启动 WebLogic 时,都会通过网络抓取所有 .class 和配置文件以及 JSP 文件,因为 Rebel.xml 文件首先获胜,这对于 VPN 来说将是可怕的。不过,部署完成后,热部署应该照常工作。我只是不想在第一次启动时通过网络传输所有类的不必要的开销,不仅如此,有时开发人员在办公室,关闭计算机,然后回家。那么 JRebel/WebLogic 会发生什么情况呢?
只查看各个 Maven 项目中哪些文件发生了更改,然后将它们通过 FTP 传输到服务器上的正确位置,这样 JRebel 就可以完全在服务器端完成它的工作,这似乎是一个更好的主意。有没有人有一个好方法来做到这一点?或者也许有人有一个根本不涉及 JRebel 的解决方案。我们来谈谈吧。
I know there is a lot of information here... but there may be other people with problems like this, and I think it would be a great help to discuss this, or at least get some decent input/suggestions brewing.
Alright, let me start out by giving an overview of our environment.
We have a multi-module maven project with about 11 JARs. Dependent on those internal JARs are 9 WAR files, of which 8 are placed in an EAR file. The remaining WAR file is deployed on its own as a separate application. When the 8 WAR files are built (that reside in the EAR), they are built as skinny WAR files, so the resultant EAR file is at a minimal size with all dependencies in the APP-INF/lib section. All of this works with no issues. We currently deploy to a remote WebLogic 10.3 server that has a lot of memory and CPU, so the load is not on our individual machines. We're also publishing nightly snapshots using a continuous integration build server.
Artifacts that we're deploying:
EAR file containing 8 WAR files, 11 internal JARs, and third party libs: ~70MB
Other WAR file: ~110MB
Some of our software engineers would like to work from home, over a VPN connection, and have incremental/hot deployment options. Otherwise, because of how we deploy with web logic/maven, they are forced to build an entire EAR file or the 110MB WAR file and upload them over VPN. This is not fun, and it's not fast. I have been reading on JRebel, and was wondering if anyone else uses JRebel with a multimodule maven project doing remote deployments, and how to do it efficiently.
From some of my reading, it is recommended to 'upload the changes' to the server and have the rebel.xml configurations reading those directories for that particular deployment which... well, brings us to the issue at hand. How do I tell Maven to dump changed resources/newly compiled class files to some other directory so that I can upload them to the server and to the appropriate folders (our server hosts something like 10+ WebLogic instances running on various ports, one instance per developer). Or just have the developers share their workspace folder with the network, and configure rebel.xml files (in a JAR, for example) point to the appropriate //COMPUTERNAME/workspace/jarProjectName/target/classes folder. The problem I foresee with that is, every time they start WebLogic, it's going to fish all the .class and configuration files and JSP files across the network, because the rebel.xml file wins first, and that will be terrible over VPN. AFTER the deploy is up though, then hot deployment should work as usual. I just don't want the unnecessary overhead of transferring all the classes over the network for the first boot, and not only that, sometimes developers are at the office, turn off their computer, and then go home. What happens to JRebel/WebLogic then?
It seems like a much better idea to only see what files have changed in the various maven projects, and FTP them to the proper location on the server so that JRebel can do it's thing, completely server side. Does anyone have a good way to do this? Or maybe someone has a solution that does not involve JRebel at all. Let's talk.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
现在也可以使用 JRebel 进行远程部署。设置非常简单,无需特殊的网络配置、在远程计算机上打开端口等。
http://zeroturnaround.com/jrebel/remoting
它严重依赖 IDE 插件,但体验就像在本地计算机上开发一样
It is now possible to use JRebel for remote deployment also. Really easy to setup, no need for special networking configurations, opening ports on the remote machine, etc.
http://zeroturnaround.com/jrebel/remoting
It relies on IDE plugin heavily but the experience is then as if you were developing on a local machine
您应该做的是让每个开发人员运行他们自己的本地 WebLogic 实例。
WebLogic 会占用相当多的内存,但必须通过 VPN 进行部署将是一个失败的提议。唯一可行的方法是使用 LiveRebel。但同样,您仍然会为网络传输付出沉重的代价,尤其是在慢速连接上。
在 JDeveloper WLS 中运行应用程序并放弃庞大的 WebLogic 共享实例可能会更好。
What you should do is have each developer run their own local instances of WebLogic.
There is a fair bit of memory usage with WebLogic, but having to do a deployment over a VPN is going to be a losing proposition. The only way this might work is using LiveRebel. But again, you will still pay a heavy penalty for network transmission, especially over a slow connection.
You are mostly likely better off running your app in the JDeveloper WLS and dropping the huge shared instance of WebLogic.
为什么不使用 samba (http://en.wikipedia.org/wiki/Samba_(software)) 协议呢?您只需要一个网络驱动器即可用作共享位置。开发人员可以将编译器路径设置为指向该位置,并且在已部署的应用程序中,rebel.xml 路径应指向相同的目录。这样就可以了。
即使开发人员关闭了机器,Weblogic 也会继续运行。
Why not to use samba (http://en.wikipedia.org/wiki/Samba_(software)) protocol for this? You will just need a network drive to be used as a shared location. Developer could set the compiler path to point to that location and in the deployed app, rebel.xml paths should point to the same directories. That would do the trick.
Even if the developer switches off his machine, Weblogic will keep running.