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 Answers
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.

- 2,108
- 9
- 7
-
Instead of `mlPostDeploy.dependsOn`, one could use `mlDeploy.doLast { }` – grtjn Aug 24 '17 at 10:10
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!

- 20,254
- 1
- 24
- 35