Adding jars to External Libraries programmably

Answered

Hello,

We need to add specific jars to a project template - I mean once the users chose my template project it creates a project with specific jars in it (in the External Libraries).

How do I do that?

 

Thank you in advanced.

0
4 comments

Could you please explain what "my template project" exactly is? Do you provide your own ModuleBuilder? Then you can modify the generated module/project from there programatically

0

Yes, I do provide ModuleBuilder but I dont know where exactly to add those jars programitically and how..

0

Override com.intellij.ide.util.projectWizard.ModuleBuilder#setupRootModel, passed in ModifiableRootModel has various methods of adding/modifying libraries, content roots etc. See also introduction http://www.jetbrains.org/intellij/sdk/docs/reference_guide/project_model/library.html

0

Thank you very much, will try to do so.

0

Please sign in to leave a comment.