Compiling Java services automatically

How can we recompile Java services in a package automatically when we reload a package with Java services on to IS?

Hmmm -you could create a flow service (I’ll call it autoCompiler) that calls ps.util.system:executeOSCommand (from the PSUtilities2 pkg).

Set the command input variable to something like “c:\webm7\integrationserver\bin\jcode.bat makeall MyPackage”.

You could then set the autoCompiler flow service to be a Startup Service for the package.


And now for the qualifier: automatically compiling services does not seem like a good idea. Most things are possible, not all things are wise.

Before doing this, I’d think hard on why you need to do this and consider whether there is another way.

I want this option because when we check in and check out the packages using VCS then each time the Java services in the modified package which is checked in needs to be recompiled. I have created a service as you mentioned but looks like to use it in real time we have to write all the Java services in a single package and add this autoCompiler as a startup service to that package. Thanks for the service, let me know if you have any other ideas about this issue.

You could specify jcode.bat all in the autoCompiler service - which will compile all packages. That way you don’t have to declare a specific package. It should skip the Wm packages that do not have source (such as WmRoot, WmPublic).

If that were the only service in a new custom package, then you could just reload that package each time you want all code recompiled.

Yes, “jcode.bat all” sounds good. I have ran it and i am satisfied with it and i think i will go with it( Create the service in a new custom package, then will just reload that package each time I want all the code to be recompiled.) Thanks again for the service, appreciate the swift responses.

Glad to help.