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 import maven project 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 import maven project 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. You can follow the Jetbrain documentation on remote debugging.In IntelliJ IDEA’s welcome dialog, click New Project.