Maven - Maven NetBeans - maven tutorial
maven tutorial tags : apache maven , maven repository , maven central
How to use Maven With Netbeans ?
- Maven is a build automation tool for Java project management. You can easily open and work with Maven projects in the IDE.
- In NetBeans IDE 6.7 and newer, Maven support is included in the IDE.
- The IDE enables you to create Maven projects from archetypes using the New Project wizard.
- The IDE also includes a Maven Repository browser that enables you to view your local repository and registered external Maven repositories.
- In NetBeans IDE 6.5, you will need to install the Maven plugin (available from the Plugin Manager) to open a project that uses Maven.
- Some of features of NetBeans are listed below:
- You can run Maven goals from NetBeans.
- You can can view the output of Maven commands inside the NetBeans using its own console.
- You can update maven dependencies with IDE.
- You can Launch Maven builds from within NetBeans.
- NetBeans does the dependency management automatically based on Maven's pom.xml.
- NetBeans resolves Maven dependencies from its workspace without installing to local Maven repository (requires dependency project be in same workspace).
- NetBeans automatic downloads required dependencies and sources from the remote Maven repositories.
- NetBeans provides wizards for creating new Maven projects, pom.xml
- NetBeans provides a Maven Repository browser that enables you to view your local repository and registered external Maven repositories.
learn maven tutorial - maven with netbeans - maven example
Open a maven project in NetBeans
- Open NetBeans.
- Select File Menu > Open Project option.
- Select Project location, where a project was created using Maven.
- We've create a Java Project consumerBanking.
learn maven tutorial - Maven Consumer Project - maven example
- Now, you can see the maven project in NetBeans.Have a look at consumerBanking project Libraries and Test Libraries.You can see that NetBeans has added Maven dependencies to its build path.
learn maven tutorial - maven netbean - maven example
Build a maven project in NetBeans
- Now, Its time to build this project using maven capability of NetBeans.
- Right Click on consumerBanking project to open context menu.
- Select Clean and Build as option
learn maven tutorial - maven netbean project - maven example
- Maven will start building the project.
- You can see the output in NetBeans Console
Output
Run Application in NetBeans
- Now, right click on App.java. Select Run File As option.
- You will see the output in NetBeans Console.