Reputation: 14719
So I'm trying to get hot deploy to work on my maven project using netbeans. I have two war packages. One I call "web" and the other I call "custom-web". I overlay (with the maven overlay plugin) "custom-web" on top of "web". I have several "custom-web" projects, one for each of my clients. So maven overlays were a good fit for my needs.
The problem is I really, really want to get hot deployment of classes and static files (.js, .css) on both projects. But the hot-deployment only works on the "custom-web" projects, if I modify a class or static file on "web" the changes are not reflected on the server unless I manually rebuild "web" and do a redeploy of the whole application which can take from 3 to 5 minutes, severely hindering my development.
I'm using Netbeans with the "deploy on save" option and the "apply code changes" when in debug mode. Both do not work on "web" files/classes.
I'm looking for a solution. My custom-web project will mostly have static files, but it can also have classes. It does not need to use overlays necessarily, but I can't figure out any other way to properly add two projects together without using overlays.
Upvotes: 4
Views: 2003
Reputation: 16
Maven profile (http://maven.apache.org/guides/introduction/introduction-to-profiles.html) is maybe a solution. You can create a "dev" one with your "web" project having dev configurations and "deploy on save" stuff.
In netbeans, you can map configurations with profiles : http://wiki.netbeans.org/MavenBestPractices#Configurations
Finally use the overlay options for your customized projects and your CI server.
Upvotes: 0
Reputation: 54437
Not sure whether that's an option, but using Jetty works great in this case. Using the jetty:run
goal, you can point Jetty to the source directories to watch (across projects), and Jetty will always serve the files from there.
In your case, you would point Jetty's scanTargets
to your source directories, and Jetty will serve the files from there.
See http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html#jetty-run-goal for configuration options and an example.
Upvotes: 1