Finding out user's configured Maven in plugin

Hey guys,

I'm building a plugin for IntelliJ IDEA 14.x. I'd like to find out what Maven home directory the user has configured in their Settings dialog (Build Execution -> Build Tools -> Maven) so that I can run some Maven commands as part of my plugin's execution.

My first attempt involved trying to use the classes under org.jetbrains.idea.maven package that I found in the community edition source code. However, when I try to use them in my plugin, IntelliJ comes back with compile errors since it claims it doesn't know about those classes. I played around with trying to add a dependency on various modules/plugins in my plugin.xml, but I haven't had any luck. I'm starting to think there might be a better approach.

Does anyone know of a way to do this?

Thanks in advance!

1 comment
Comment actions Permalink

To access the classes of the Maven plugin in your plugin, in addition to adding the <depends> tag, you also need to add the jars of the plugin to the classpath of your IntelliJ IDEA SDK.


0

Please sign in to leave a comment.