Find the building tool and add dependency

Answered

How i can find what building tool (e.g.Maven, Gradle) the project is using and add a dependency programmatically?

0
3 comments

Theodosios,

You can access all project's modules with:

ModuleManager.getInstance(project).getModules()

Adding dependencies programmatically is not supported out of the box. You'll have to work with Psi model at this point.

0
Avatar
Permanently deleted user

Jakub Chrzanowski thanks for the answer but this returns me the .iml files. 

How i can find from there the build.gradle or the pom.xml to add a debendency?

0

You can loop through the returned modules and check their types i.e. with:

MavenUtil.isMavenModule(module)

or:

FacetManager.getInstance(module).getFacetByType(FacetTypeId);
0

Please sign in to leave a comment.