Looking to add post modules deploy calling a java class in ml-gradle and roxy

118 Views Asked by At

I have a java class that I want to call on post deployment of modules for MarkLogic in both ml-gradle and roxy. Are there any examples for either of these out there?

2

There are 2 best solutions below

1
On

For ml-gradle, is it fine to have the Java class called at the end of "mlDeploy"? If so, you can do that easily by creating a Gradle task of type JavaExec, and then having mlPostDeploy depend on it, e.g.

mlPostDeploy.dependsOn myCustomTask

If you need it to run immediately after modules are loaded and before any other ml-gradle commands are executed, you'll need to make your own command that's part of mlDeploy - see https://github.com/marklogic-community/ml-gradle/wiki/Writing-your-own-command for more info and feel free to post an issue in ml-gradle if you run into problems.

0
On

Roxy runs on Ruby, so you will have to do a system-call to invoke Java. We do that internally too to invoke MLCP, Corb2, XQSync, and RecordLoader:

https://github.com/marklogic-community/roxy/blob/master/deploy/lib/server_config.rb#L1399

HTH!