What is the best way to take dependency library in Plugin


Dear all I am developing idea plugin based on Gradle workflow. 
Have compile time dependency from other libraries in my built.gradle. 
Want to take that jar file run time and get from there some property.

Is this the best way of doing that


File pluginFile = Objects.requireNonNull(PluginManager.getPlugin(PluginId.findId("com.metaring.platform-plugin-idea"))).getPath(); 
File pluginLibFile = new File(pluginFile.getAbsolutePath() + File.separator + "lib"); 
File[] platformIdeJarFiles = pluginLibFile.listFiles(file -> file.getName().contains("platform-ide-plugin")); 

Same question here


Comment actions Permalink

What exactly is "get from there some property"? If you want to access some resouce located in JAR file, you can use getClass().getResource() etc.

Comment actions Permalink

"get from there some property" -  I have json.file in xxx.jar which is in dependency of my plugin.

Beside of what I mentioned in above code, is there any possibility to take the file content through the Idea API ?



Comment actions Permalink

What do you expect the platform API to do for you?

Comment actions Permalink

For example providing all plugin dependency libs or ids of dependency libs (like you have in getDependentPluginIds() method).

As I mentioned I can shortly take the dependency jars folder where situated lib folder, under which have jars what I need:


Anyway, now using another functionality in my plugin and for now this part just for curiosity.


Thanks for your patience and time


Please sign in to leave a comment.