- Copy the new class files to be included into a tmp folder.
- Take the jar file too to this tmp folder
- Extract the class files which need to be replaced, out from the jar. This should be extracted into the tmp folder with the same directory structure as it was packed initially.
- Now, replace these class files extracted from the jar with the new class files(don't change the directory structure, keep the same but replace old class files with new one)
- Open the jar file. Drag and drop the directory containing the class files into the jar.
- Now, the jar contains the new class file. The same can be tested by sorting all the classfiles inside the jar with time stamp.
This process is useful when we have a lot of class files packed in the jar and only a very few of them need to be replaced. Building the whole jar again would take significantly more time. Instead, this work around can be used. Restarting the server should suffice to pick the new jar.
0 comments:
Post a Comment