Is there a way to automate the setup of IntelliJ projects
已回答
I have the problem, that the software at my work consists of many individual components and libraries. All of them need to be checked out of svn/git first, then imported as maven modules. Since we work with many branches, this takes a lot of time, each time a new branch of every project/component is created.
Is there a way/plugin/script language, so I can automate the import of all maven projects as "new maven module from existing sources" in IntelliJ?
On the filesystem I have the following situation,
/home/den/projects/projectA/pom.xml
/home/den/projects/projectB/pom.xml
/home/den/projects/projectC/pom.xml
and I like to have one workspace with all modules auto-imported.
请先登录再写评论。
Hello Dennis,
The quickest solution would probably be to:
One other thing. There's a file called misc.xml in the .idea default project directory. It contains various project config related data, including the information about a project's modules. You can try including it into each branch checkout so that this information is preserved.
You can also vote for the following issues:
See this article if you are not familiar with YouTrack.
Hi Arina,
thanks for your answer. The option with the aggregator project is better than really importing everything by hand. What unfortunately doesn't work this way is that you can't have one Maven project imported in multiple workspaces.
Example
Workspace 1:
Component 1
Library1
Library2
Workspace 2:
Component 2
Library2
Library 3
Would it be possible to control the maven import via command line or is there a custom plugin api method to import a maven project as module without any dialog appearing?
Hi Dennis.
Answering you direct questions:
Yes, of course u can create a plugin for this. Please look at documentation https://jetbrains.org/intellij/sdk/docs/basics/basics.html, also see jetbrains-platform.slack.com - our slack support channel for plugin developers
You can use ProjectUtil.openOrImport methods to open maven project as a new project
Also, you can look at MavenImportWizardTest.testImportModule to see how you can import module without any dialog.
Also you can create a feature request here https://youtrack.jetbrains.com/newIssue?project=IDEA
Going deeper
I assume that you used eclipse before, right?
Could you please share your experience, how do you want to open module from existing sources. Is getting rid of wizard window (Import module) will be enough for you? Or I missed something?
Hi,
yes it would be sufficient if you could select multiple parent pom files from different directories and then import them all with the default Maven import settings or that the import dialog comes only once and then all projects are imported with these settings.