
Find the folder in the tree on the right and select it.

Everything in that folder will be added to CLASSPATH. In IntelliJ IDEA, Make Project will trigger the necessary build. By default, this happens automatically in Eclipse when you save your changes. Then either add as a source or test source. Note: The Class-Path header points to classes or JAR files on the local network, not JAR files within the JAR file or classes accessible over Internet protocols. I’m trying to add this in the allprojects block like this: … Java's standard java.

Click on the Green Plus and select Application: Give it a name. If you have used the JRebel for IntelliJ plugin before, you may be familiar with the JRebel launchers - the Run with JRebel and Debug with JRebel toolbar buttons and the respective Run menu items. select your JAR file or you can select the directories. These files are located in the classpath of your application, and are usually loaded from the classpath using the following methods: ResourceBundle. xqy” to the end of the list of patterns to get our files picked up.
INTELLIJ MAVEN HOW TO
Maven should have generated jar file for each project there.That’s how to create a multi-module Maven project in IntelliJ IDEA.Intellij add resource folder to classpath.
INTELLIJ MAVEN INSTALL
Select the root project, and click button Execute Maven Goal, and double click mvn install from the list, as shown below: Then you should see the Maven’s build success output as follows: Now you can check the target directory in each project. Build a Multi-Module Maven project in IntelliJ IDEATo build the whole multi-module Maven project in IntelliJ IDEA, open Maven view. SwingUtilities.invokeLater(new Runnable() void run() You see, this class also makes use of the CommonUtility class from the SharedLibrary project.ĥ. Static String appName = CommonUtility.getAppName() Īdd(new JLabel("Welcome to " + appName))
INTELLIJ MAVEN CODE
We would end up having the modules declared in the root project like this: įor demo purpose, code a simple Swing program for the desktop app with the following code: package com.mycompany Create the DesktopApp projectSimilar to the ConsoleApp project, create the third Maven module for the DesktopApp project.

}You see, this class makes use of the CommonUtility class from the SharedLibrary project.Ĥ. String appName = CommonUtility.getAppName()
INTELLIJ MAVEN UPDATE
Note: You may need to Reload Maven project to update the dependency information.Then code a simple console program like this: package com.mycompany And in order to reference the SharedLibrary project, you should declare the dependency in the pom.xml file of the ConsoleApp project as follows: Create the ConsoleApp projectSimilarly, create the second Maven module for the ConsoleApp project. }The static method getAppName() will be used by both console app and desktop app.ģ. And in this SharedLibrary project’s pom.xml file, it specifies the parent information as below: Īnd code a simple class in this project as follows: package com.mycompany You see, it specifies the packaging type is pom, and adds a module named SharedLibrary. You can notice the pom.xml file of the root project was updated: IntelliJ IDEA will create the SharedLibrary project under CompanyProject. Note that the parent module is CompanyProject: Click Finish. Right-click on the root project, and select New > Module: Then enter the module name as SharedLibrary.

Create the SharedLibrary projectNext, we create the first Maven module for the shared library project. Choose Maven and click Next: Enter project name and specify artifact coordinates information as below: Click Finish. In IntelliJ IDEA’s welcome dialog, click New Project.
