External jars are not getting indexed


I have a plugin that loads up a project, given the directory path and required jars(All external libraries required). I have a flow (after the project is loaded fully) that requires full indexing to be done before it can do anything properly. Now, when I say full indexing, I mean that the external jars provided should also be indexed. I used the code provided in this post to try and load up the jars so that they are added to the indexing: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000036724-Programmatically-add-directory-based-dependency-library-to-module. I can see the library being added in the module dependencies, but they are still not indexed. Can anyone help me in getting this right?

I can get the indexing working properly when I add the jar directory in Project Structure-> Module -> Add jars and directories and then re-Index. Any way I can simulate this programmatically?

Update 1: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000036724/comments/360001773740. This comment is the exact issue I am facing.

1 comment

Please show/link your code and the place where it's invoked exactly. Also please specify IDE version.


Please sign in to leave a comment.