1

I am using gradle 6.8 and MarkLogic version is 10.0-5.2,

My XQuery code is in directory \ml-gradle\src\main\common. When I run the command mlLoadModules to load XQuery into the modules database it loads with default URI /common/test.xqy.

I want to add some prefix to the URIs e.g. /rsc/common/test.xqy. How can I achieve that?

Note: I don't want to create an extra folder in my source for prefix "rsc".

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147

1 Answers1

1

It's not supported, though you could write a custom Gradle task to change the URI to whatever you like.

Why do you not want to create an "rsc" folder above "common"? I think other developers would find it much more intuitive that "rsc/common/test.xqy" becomes "/rsc/common/test.xqy" when loaded, rather than "common/test.xqy" becomes "rsc/common/test.xqy", which begs the question - where is "rsc" coming from? And then that developer would need to understand what property / custom code is adding that "rsc".

rjrudin
  • 2,108
  • 9
  • 7
  • Thanks for your response @rjrudin, i thought that there might be any property which can be defined in the "gradle.properties" file so that URI can be modified during execution of mlLoadModules. – Dharmendra Kumar Singh Mar 08 '21 at 13:58
  • As i have two different module database where the common xquery files can be loaded from common directory, so if create a rsc directory then the prefix "rsc" will appear in both URI .As I want that for the one module database URI will be different. – Dharmendra Kumar Singh Mar 08 '21 at 14:06
  • That is the case where i don't want to create directory "rsc". – Dharmendra Kumar Singh Mar 08 '21 at 14:07
  • The feature doesn't exist yet - these are the properties for loading modules - https://github.com/marklogic-community/ml-gradle/wiki/Property-reference#module-and-schema-properties . Create a ticket at ml-gradle for this if you'd like. Sounds like you'd want e.g. "mlModulesUriPrefix"? Note that this would only apply for non-REST extensions - REST extensions like search options, transforms, and services have their URI set by the REST API, not by ml-gradle. – rjrudin Mar 09 '21 at 14:05