How do I add an existing module to IntelliJ
John Parsons
Updated on April 08, 2026
From the main menu, select File | New | Module from Existing Sources.In the dialog that opens, specify the path the . iml file of the module that you want to import, and click Open. By doing so, you are attaching another module to the project without physically moving any files.
How do I install IntelliJ modules?
In the Project tool window, right-click a module, and select Load/Unload Modules. You can double-click a module in the dialog to load or unload it, or use the buttons in the middle of the dialog.
How do I add dependent modules in IntelliJ?
- From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Modules | Dependencies.
- Click. Alt+Insert and select a dependency type: JARs or directories: select a Java archive or a directory from files on your computer.
How do I copy a module in IntelliJ?
- In the dialog that pops up you then choose the name and the location for the new module.
- After pressing OK, the module will be cloned and ready to use.
How do I manually import dependencies into IntelliJ?
Add a Maven dependency Dependencies that you set up manually inside IntelliJ IDEA module settings will be discarded on the next Maven project reload. Open your POM in the editor. Press Alt+Insert to open the Generate context menu. From the context menu, select Dependency or Dependency Template for quick search.
How do I mark a folder as module in IntelliJ?
From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Modules. Select the necessary module and open the Sources tab. next to Source Folders or Test Source Folders. Specify the package prefix and click OK.
How do I add a class to a module in IntelliJ?
In the Project tool window ( Alt+1 ), right-click the node in which you want to create a new class and select New | Java Class. Alternatively, select the node, press Alt+Insert , and select Java Class. Name the new class and press Enter . Follow the Java naming convention as you create new classes.
How do I install an existing Maven project in IntelliJ?
- Open IntelliJ IDEA and close any existing project.
- From the Welcome screen, click Import Project. …
- Navigate to your Maven project and select the top-level folder. …
- Click OK. …
- For the Import project from external model value, select Maven and click Next.
How do I create a multi module spring boot project in IntelliJ?
Open the Intellij and go to File-> New -> Project. From the left tab, select Spring-initializr and select Project SDK in right pane and click next.
How do I create a multi module Maven project in IntelliJ?- Maven.
- Create a new Maven project.
- Create a Java EE project with Maven as a build tool.
- Open an existing Maven project.
- Configure the Maven settings before opening a new project.
- Add a new Maven module to an existing project.
- Configure a multi-module Maven project.
- Access the Maven settings.
How do I add a module dependency in build gradle?
- Apply plugins in the module’s build. gradle file.
- Declare dependencies in build. gradle (if necessary).
- Include the module in your build manifest file (if necessary).
- Sync Gradle.
- Deploy the module to the server.
How do I add a dependency to a POM file?
- Right-click the utility project, and select Maven>Add Dependency.
- Type a dependency name in the Enter groupID… …
- Select the dependency, and click OK.
- Expand the utility project, right-click the pom. …
- View the Console.
How do I install IntelliJ Community Edition plugins?
Press Ctrl+Alt+S to open the IDE settings and select Plugins. and then click Install Plugin from Disk. Select the plugin archive file and click OK. Click OK to apply the changes and restart the IDE if prompted.
How do I add a dependency to an existing Spring project?
- Open the pom. xml file in your project root directory.
- With the pom. xml file open in the editor, from the main menu, select Code | Generate Alt+Insert and then select Dependency.
- In the Maven Artifact Search dialog, find and add the necessary Maven dependencies: org. …
- Click.
How do I import gradle dependencies into IntelliJ?
- Open the build. …
- Press Alt+Insert to open the Generate context menu.
- From the context menu, select Add Maven artifact dependency.
- In the dialog that opens either search for artifacts or for classes if you switch to the Search for class tab. …
- Click Add and reload your project.
What is module in IntelliJ?
In IntelliJ IDEA, a module is an essential part of any project – it’s created automatically together with a project. Projects can contain multiple modules – you can add new modules, group them, and unload the modules you don’t need at the moment.
How import all classes in IntelliJ?
- In the Settings/Preferences dialog ( Ctrl+Alt+S ) , select Editor | Code Style | Java | Imports.
- Clear the Use single class import checkbox, and apply the changes.
How do I create a multi module in gradle project?
- Create the root directory of the core module (core) and create the following the subdirectories: The src/main/java directory contains the source code of the core module. …
- Create the root directory of the app module (app) and create the following subdirectories:
How do I run code in IntelliJ?
To run a script, open it in the editor or select it in the Project tool window, and then select Run <script file name> from the context menu. IntelliJ IDEA creates a temporary run/debug configuration of the type Node.
How do I create a directory module?
- Find the pom. xml in the directory.
- Right click the pom. xml .
- Then you can see the popup windows. Select the last item “add as maven project file” .
- Then, the maven build tool can automatically discern the directory as an module and import the specified jar dependencies.
How do I add SRC test resources in IntelliJ?
- From the main menu, select File | Project Structure ( Ctrl+Alt+Shift+S ) or click. …
- Under Project Settings, click Modules and then open the Sources tab on the right.
- Right-click the test folder and select New Folder. …
- Right-click the new folder and select Test Resources.
How do I create a relative path in IntelliJ?
Press Ctrl+Alt+S to open the IDE settings and select Appearance & Behavior | Path Variables. and enter the name of the new variable (for example, PATH_TO_LIB ) and its value that points to the library location on your disk. Share the IML file through your version control system.
How do I add multiple projects in IntelliJ?
- File > New > Module from Existing Sources…
- Select the project e.g. /local/projects/projectX. If available select the build. gradle or another file that indicates the project model.
- Finish the wizard.
How import multi-module Gradle project IntelliJ?
File –> Import > Gradle STS project -> Choose project root where multi-module folders reside -> click Build Model -> choose the modules I want to see in the IDE.
What is multi-module project in spring boot?
A Spring Boot project that contains nested maven projects is called the multi-module project. In the multi-module project, the parent project works as a container for base maven configurations. In other words, a multi-module project is built from a parent pom that manages a group of submodules.
How do I run an existing Java project in IntelliJ?
- Launch IntelliJ IDEA. …
- In the dialog that opens, select the directory in which your sources, libraries, and other assets are located and click Open.
- When you import or clone a project for the first time, IntelliJ IDEA analyzes it.
How do I import a Git project into IntelliJ?
- Open the project that you want to put under Git.
- Choose Enable Version Control Integration from the VCS Operations Popup Alt+` or from the main VCS menu.
- Choose Git as the version control system and click OK.
How do I import Maven into IntelliJ?
- In the Maven tool window, right-click a linked project.
- From the context menu, select Reload project . On invoking this action, IntelliJ IDEA parses the project structure in the Maven tool window.
How do I run a multi module project in Maven?
- Step 1 : Create Parent project. mvn archetype:generate -DgroupId=com.websystique.multimodule -DartifactId=parent-project. …
- Step 2 : Update pom. …
- Step 3 : Create sub-modules. …
- Step 4 : Update sub-modules pom. …
- Step 5 : Import these projects as ‘Existing maven projects’ in Eclipse.
How do I add a parent POM in IntelliJ?
Press Ctrl+Alt+M or select Refactor | Extract | Extract Managed Dependency. IntelliJ IDEA extracts the selected dependency into a parent POM, automatically creating a dependencyManagement section and a full dependency definition.
How do I create a project Maven project in IntelliJ?
Add Maven support In the Project tool window, right-click your project and select Add Framework Support. In the dialog that opens, select Maven from the options on the left and click OK. IntelliJ IDEA adds a default POM to the project and generates the standard Maven layout in Project tool window.