IntelliJ: Working on multiple projects

前端 未结 19 1949
抹茶落季
抹茶落季 2020-11-27 09:18

We build in maven multiple projects (let\'s name them A,B,C). Project A uses .jar of project B which uses .jar of project C.

I am modifying codes of all A/B/C projec

相关标签:
19条回答
  • 2020-11-27 09:32

    For people not using maven to build and wanting to add a new project (I am using intellij 14.1.3):

    1. Right click the top level folder in the project view, select new -> Module
    2. Name the module the same name as the project to be added
    3. From the top menu select File->New->Project. Enter the same name as the new module, same folder locations as well.
    4. Open the Project, and wait for intellij to create the project structure.
    5. Close this new project, and open the original project the module was added to in step 2

    Depending on your builder, additional steps will be needed to add it to the build process.

    For SBT, and in the top level project I modified the Build.scala file to aggregate the new project, and added the project in the SBT projects window. More info on SBT multiproject builds: http://www.scala-sbt.org/0.12.2/docs/Getting-Started/Multi-Project.html

    0 讨论(0)
  • 2020-11-27 09:34
    • new empty project
    • File -> New -> Module from Existing Sources
    0 讨论(0)
  • 2020-11-27 09:34

    Press "F4" on windows which will open up "Project Structure" and then click "+" icon or "Alt + Insert" to select a new project to be imported; then click OK button...

    0 讨论(0)
  • 2020-11-27 09:34

    I am new to maven and did not understand how I could work with local maven project added through Viktor Nordling's answer and still have a proper dependency in pom.xml file. The answer is simple: intellij first looks at your locally added module and if it doesn't find one it goes to get the project remotely. You can check this by looking at "external libraries" under your project browser when you add or remove maven module.

    Hope this helps anyone.

    0 讨论(0)
  • 2020-11-27 09:35

    As of release 2019.2, this is as easy as File->Attach Project.

    0 讨论(0)
  • 2020-11-27 09:37

    None of the solutions worked for me, since I am not working on Maven projects. There is a simpler solution. Go to:

    File->Project Structure->Modules.

    Instead of adding module, simply click the third option (copy). Browse your local directory and select the project you would like to add. Module name will resolve automatically. That's it.

    Update: When you want to reopen to project with multiple sub-projects, in order to avoid re-doing steps as described above, just go to File->Open Recent->'Your Big Project'.

    0 讨论(0)
提交回复
热议问题