![]() ![]() Exclude items from a project or a global libraryĬlick and select the library items that you want to exclude.įrom the main menu, select File | Project Structure Ctrl+Alt+Shift+S and go to Modules | Dependencies.Įxcluded items will be marked with the icon. However, when you compile or run your code, a library will still be used as a whole, irrespective of whether there are excluded items in that library or not. You can exclude folders, archives (for example, JARs) and folders within archives.Ĭlasses from excluded packages won't be shown in code completion suggestion lists, references to such classes will be shown in the editor as unresolved, and so on. IntelliJ IDEA allows you to temporarily exclude library items in order to increase IDE performance. Right-click the necessary library and select Copy to Project Libraries or Add to Modules. ![]() For example, use this procedure if you want to add more classes to a project library, but you want to use them in one module only. You can create a copy of a library on a lower level. Right-click the necessary library and select Move to Project Libraries or Move to Global Libraries. For example, use this procedure if you want to use a module library across the project or the entire IDE.įrom the main menu, select File | Project Structure Ctrl+Alt+Shift+S and locate the library that you want to change. This is helpful if you want to extend its scope of usage. In IntelliJ IDEA, you can move a project or a module library to a higher level. Select the dependencies you want to include in the library and click OK.Ĭhange the library level Move a library to a higher level ![]() In the next dialog, click Edit, and then click Configure next to the Include transitive dependencies option. Select the necessary Maven library and click. If you want to include only specific transitive dependencies, you can use the library properties editor.įrom the main menu, select File | Project Structure Ctrl+Alt+Shift+S, and go to Modules | Dependencies. You can also configure a custom remote repository. IntelliJ IDEA will download the library from Maven or Nexus public repositories. You can also specify another library location, and select whether you want to download transitive dependencies, source files, Javadoc files, or annotations. If you don't know its exact name, enter the key words and click. In the next dialog, specify the library artifact (for example, org.jetbrains:annotations:16.0.2). Download a library from Mavenįrom the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Libraries. For more information on module files, refer to Modules. This file is used for keeping module configuration. References to module libraries are stored in the module. In the dialog that opens, select a project or a global library that you want to add to the module.Īlternatively, click New Library and select how do you want to add a new library: you can add a Java and Kotlin libraries from files on your computer, or download a library from Maven. Select the module for which you want to add a library and click Dependencies. Global and project libraries are not available until you add them to module dependencies.įrom the main menu, select File | Project Structure | Project Settings | Modules. References to project libraries are stored together with the project in the. Under Project Settings, select Libraries. References to global libraries are stored in the IDE configuration directory in options | applicationLibraries.xml. Select From Maven to download a library from Maven. Select Java or Kotlin/JS to add a library from the files located on your computer. Under Platform Settings, select Global Libraries. Define a global libraryįrom the main menu, select File | Project Structure Ctrl+Alt+Shift+S. Select these files in the Project tool window, and then select Add as Library from the context menu. You can also create a new library from the JAR files located within a project content root. IntelliJ IDEA will also use the code from the libraries to build and deploy your application. Define a libraryĪfter you define a library and add it to module dependencies, the IDE will be supplying its contents to you as you write your code. If you're using a build tool, such as Maven or Gradle, make all changes using the build file. This information is valid for projects that are built with the native IntelliJ IDEA builder. In IntelliJ IDEA, libraries can be defined at three levels: global (available for many projects), project (available for all modules within a project), and module (available for one module).Ī Java library can include class files, archives and directories with class files as well as directories with native libraries. A library is a collection of compiled code that you can add to your project. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |