Search code examples
javaservletsnetbeansglassfish-4

Is there a way to use NetBeans's deploy on save within local LAN (JAVA Servlet)


I am working on a Java servlet project using NetBeans.

I am looking for a way to use NetBeans’s “deploy on save” on another browser of my device within LAN (locally its working fine) so that I don’t have to manually reload my browser during my development.

Recently I have decided to use proxy feature of Browsersync, but the problem of the Browsersync is, it auto reloads browser early before NetBeans completes deployment on save.

I am using GlassFish(4.1) with NetBeans.

Any help is greatly appreciated.


Solution

  • I had to something different in order to achieve the solution.

    I am watching “glassfish/domains/domain1/config/” folder using Browsersync. Looks like after building the project, few files modified here during hot reload (so I have used watchEvents from Browsersync).

    The proxy site instantly reload after NetBeans completes deployment on save.

    Following is the Browsersync command.

    These directory names have to be the full path with drive letter.

    browser-sync start --proxy "http://localhost:8080/test" --files "src/java/com/test/, glassfish/domains/domain1/config/" --watchEvents add change " src/java/com/test/, glassfish/domains/domain1/config/" --no-notify --host 192.168.X.X --port 5000