简体   繁体   中英

create intellij project and modules programmatically

I have a large project with many large directory structure. They produce around 90 JARs. The IntelliJ project structure is not the same (or similar) to the one seen by Ant scripts. This creates a lot of problems while editing the code. Main side effect is incorrect dependencies get added. Essentially I am looking to create a one-jar one-module mapping

Is it possible to create Intellij modules programmatically? I can re-use existing set of libraries, created in IntelliJ

Please consider using Maven or Gradle instead, IDEA supports both. Maven support is more mature, Gradle support will improve in the future updates.

Your Maven projects will work with all the major IDEs and command line, not just IntelliJ IDEA.

@CrazyCoder is right using maven would be a better solution, but that conversation may just be a little bit too much to swallow.

The .iml files are just xml and while it isn't documented it is pretty understandable. It shouldn't be the trickest thing to create a template and then use either ant property replacement or a custom task to generate these files for each module.

For reference you may want to look at the source for the maven-idea-plug it generates .iml files for a maven project and may provide you with a hint on how todo this with ant. Note that @CrazyCoder points out the comments that this should only be a reference...don't use this for maven support in Idea.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM