- Maven - Discussion
- Maven - Useful Resources
- Maven - Quick Guide
- Maven - Questions and Answers
- Maven - IntelliJ IDEA
- Maven - NetBeans
- Maven - Eclipse IDE
- Maven - Web Application
- Maven - Deployment Automation
- Maven - Manage Dependencies
- Maven - Build Automation
- Maven - Snapshots
- Maven - Project Templates
- Maven - Project Documents
- Maven - External Dependencies
- Maven - Build & Test Project
- Maven - Creating Project
- Maven - Plug-ins
- Maven - Repositories
- Maven - Build Profiles
- Maven - Build Life Cycle
- Maven - POM
- Maven - Environment Setup
- Maven - Overview
- Maven - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Maven - IntelpJ IDEA IDE Integration
IntelpJ IDEA has in-built support for Maven. We are using IntelpJ IDEA Community Edition 11.1 in this example.
Some of the features of IntelpJ IDEA are psted below −
You can run Maven goals from IntelpJ IDEA.
You can view the output of Maven commands inside the IntelpJ IDEA using its own console.
You can update maven dependencies within IDE.
You can Launch Maven builds from within IntelpJ IDEA.
IntelpJ IDEA does the dependency management automatically based on Maven s pom.xml.
IntelpJ IDEA resolves Maven dependencies from its workspace without instalpng to local Maven repository (requires dependency project be in same workspace).
IntelpJ IDEA automatically downloads the required dependencies and sources from the remote Maven repositories.
IntelpJ IDEA provides wizards for creating new Maven projects, pom.xml.
Following example will help you to leverage benefits of integrating IntelpJ IDEA and Maven.
Create a new project in IntelpJ IDEA
We will import Maven project using New Project Wizard.
Open IntelpJ IDEA.
Select File Menu > New Project Option.
Select import project from existing model.
Select Maven option
Select Project location, where a project was created using Maven. We have created a Java Project consumerBanking. Go to ‘Creating Java Project chapter, to see how to create a project using Maven.
Select Maven project to import.
Enter name of the project and cpck finish.
Now, you can see the maven project in IntelpJ IDEA. Have a look at consumerBanking project external pbraries. You can see that IntelpJ IDEA has added Maven dependencies to its build path under Maven section.
Build a maven project in IntelpJ IDEA
Now, it is time to build this project using capabipty of IntelpJ IDEA.
Select consumerBanking project.
Select Buid menu > Rebuild Project Option
You can see the output in IntelpJ IDEA Console
4:01:56 PM Compilation completed successfully
Run Apppcation in IntelpJ IDEA
Select consumerBanking project.
Right cpck on App.java to open context menu.
select Run App.main()
You will see the result in IntelpJ IDEA Console.
"C:Program FilesJavajdk1.6.0_21injava" -Didea.launcher.port=7533 "-Didea.launcher.bin.path= C:Program FilesJetBrainsIntelpJ IDEA Community Edition 11.1.2in" -Dfile.encoding=UTF-8 -classpath "C:Program FilesJavajdk1.6.0_21jrepbcharsets.jar; C:Program FilesJavajdk1.6.0_21jrepbdeploy.jar; C:Program FilesJavajdk1.6.0_21jrepbjavaws.jar; C:Program FilesJavajdk1.6.0_21jrepbjce.jar; C:Program FilesJavajdk1.6.0_21jrepbjsse.jar; C:Program FilesJavajdk1.6.0_21jrepbmanagement-agent.jar; C:Program FilesJavajdk1.6.0_21jrepbplugin.jar; C:Program FilesJavajdk1.6.0_21jrepb esources.jar; C:Program FilesJavajdk1.6.0_21jrepb t.jar; C:Program FilesJavajdk1.6.0_21jrepbextdnsns.jar; C:Program FilesJavajdk1.6.0_21jrepbextlocaledata.jar; C:Program FilesJavajdk1.6.0_21jrepbextsunjce_provider.jar; C:Program FilesJavajdk1.6.0_21jrepbextsunmscapi.jar; C:Program FilesJavajdk1.6.0_21jrepbextsunpkcs11.jar C:MVNconsumerBanking argetclasses; C:Program FilesJetBrains IntelpJ IDEA Community Edition 11.1.2pbidea_rt.jar" com.intelpj.rt.execution.apppcation.AppMain com.companyname.bank.App Hello World! Process finished with exit code 0Advertisements