In practice, we often encounter situations in which a common project (MAVEN project) is created as a public project, and many of the tool classes in common can be called by multiple other projects.
For example, the common and service are separated into separate MAVEN projects for use by other projects and are referenced through MAVEN by other projects through the jar.
Web projects now need to reference common and service, and if idea opens common, service, and Web projects separately, when debugging Web projects, You will encounter difficulties: both the common of the Web reference and the code in the service are packaged into jars and cannot be debugged. Unless common and service install the source code to the local repository, but that is not convenient, each time the common and service updates require MAVEN install operation, the web will not be updated by reference.
1.Eclipse Solutions
Eclipse has the concept of workspace, put common, service, the Web into a workspace, eclipse will open all the projects in workspace, Eclipse will automatically find dependencies, In the Web Click Common code, will jump directly to the corresponding source in the common, debugging, can also be transferred to the common single-step debugging, very convenient.
So can using IntelliJ idea also achieve workspace function? Of course, IntelliJ idea is very powerful and this feature must have!
2.IntelliJ Concept Solution
2.1 First, download the common, service, and web three items from SVN to a local directory, such as download to a folder named workspace:
2.2 Open the IntelliJ idea Compiler, click the menu File->open ..., select the workspace directory you just found:
Click OK to open the workspace directory. Open the following interface as follows:
2.3 When open, it is found that idea does not automatically identify the MAVEN project, and at this point you need to manually add the project's Pom.xml file to the MAVEN projects bar on the right side, so that you can identify:
CTRL + Select the Pom.xml file, then click the OK button.
2.4 Well, here's the idea to identify dependencies between the various MAVEN projects.
You can happily develop and debug!
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
IntelliJ idea open multiple projects like eclipse