Reputation: 6072
I am new very much new to maven and spring technologies. I want to know how can we auto deploy the java server code without rebuilding the maven or without restarting the glass fish server? Currently I have to restart the server if any change I do in java code. I have also use one option in Eclipse to "Automatically publish when resources change" but no use.
Upvotes: 0
Views: 1097
Reputation: 7710
The recent version of HotSwap Agent works very well for me with Eclipse and Payara Server (server derived from and compatible with GlasFish).
It's free and opensource and supports Java 8, including lambdas. It supports reloading of resources in a webapp running on GlassFish/Payara, including JAX-RS annotations, CDI bean definitions etc., without restarting whole application.
The only drawback is that you need to install the DCEVM plugin into the JDK, which has to be activated by a command line argument -XXaltjvm=dcevm
. But this isn't intrusive and doesn't affect your JDK if you avoid the argument - you can activate it just for GlassFish/Payara Server when you add it to the JVM options in the domain configuration. When adding the -XXaltjvm=dcevm
option, you also have to remove -client
and -server
option, because they take precedence.
So, essentially these steps are needed with the recent version of HotSwap agent and practically with any version of GlassFish and Payara Server:
hotswap-agent.jar
into lib/ext
in your domain directory-XXaltjvm=dcevm -javaagent:/path/to/hotswap-agent.jar
There is some information in this Payara issue, although it isn't an easy to follow guide. Some more info in this HotSwap issue.
Upvotes: 0
Reputation: 43
You may want to take a look at JRebel, it reloads changes made to your code instantly without having to restart your application server.
Upvotes: 2