Background:
I’m working on an issue in ISM to add a feature in opensearch index-management plugin. For this, I need to import some classes from opensearch cross-cluster-replication project for the same.
In the ism project, I have added ccr dependency in build.gradle like this
Issue:
On running ./gradlew build, it downloads the opensearch-cross-cluster-replication-3.0.0.0-SNAPSHOT.jar under build/tmp/.cache/expanded.
But it does not allow to import classes from this jar in the src code. For ex. import org.opensearch.replication.action.pause does not work and shows unresolved reference.
Expectation: To be able to import classes from ccr project and create request objects for some actions.
How to achieve this? Any helpers will be greatly appreciated!
PFA - This is my build.gradle for index-management plugin.
I have tried to ape almost all actions happening with job-scheduler plugin and tried to do the same with ccr plugin. I’ve also tried defining the ccr dependency for compileOnly and implementation, but no luck!
Another thing I’ve noticed : under Project > External Libraries, it does list the cross-cluster-replication jar, but it does not list the classes under this jar.
Another observation is:
I have tried to import multiple opensearch-plugins that are based on kotlin - mainly, cross-cluster-replication, index-management, alerting -
For all these, under Project > External Libraries > It displays the dependency as a zip. That is not the case for other opensearch plugin dependencies like job-scheduler (java based).
This is in contrast to what we see with java based dependencies as shown in my previous comment.
For all these attempted kotlin dependencies, I am unable to import classes in src code and use.
Would highly appreciate any guidance in this area and are there any changes needed in these dependencies projects too?