Advertisment

Home

Showing posts with label Maven. Show all posts
Showing posts with label Maven. Show all posts

Saturday, December 3, 2016

Integrating Maven to Netbeans, Eclipse and IntelliJ

Mavens popularity has grown in large scale through these years. And many integrated development environments that used with Java, has started to integrate maven with their products.

For example, maven is already setup to integrate with,

  • NetBeans 
  • Eclipse 
  • IntelliJ 
NetBeans Integration 

Starting with the NetBeans 6.7 and higher, there is full Maven support. Using the new projects wizard in NetBeans you can create projects using archetypes in Maven. And the IDE also includes a Maven repository browser that enables the user to view local repository as well as registered external maven repositories. If you have NetBeans versions 6.5 or lower you can add maven by adding the necessary plugins under,

Tools -> Plugins -> Choose Available Plugins -> Choose Maven -> Install and then close.

You can find detailed documentation from wiki.NetBeans.org  . You can find Maven tutorials tips and tricks in NetBeans.

Eclipse Integration 

If you are accustomed to use Eclipse for development. Then you have M2Eclipse version for Maven integration. This can be used to create new Maven projects. And also can handle dependency management. Based on Mavens pom.xml file. Also this perform automatic downloads of required dependencies. 

You can get detailed documentation about M2Eclipse from Eclipse.org/m2e/ .

Go to Help -> Install New Software 

http://download.eclipse.org/technology/m2e/releases/

Enter the above site location in Work with field and press Enter. Then select all the packages and install them. 

IntelliJ Integration 

You can get full Maven support with IntelliJ IDEA from JetBrains. It can be used to import existing projects or create new ones. It has full editing support for the pom.xml files. you can find detailed documentation from JetBrains.com/idea.

To get started with maven just go to IntelliJ IDEA and then create new project and select Maven from there. then go as on...

If you have any questions feel free to post them in comment section.!

Get started with Apache Maven

What is Apache Maven? 

Apache Maven is a Software Project Management and Comprehension tool, Based on the concept of a Project Object Model(POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
-http://maven.apache.org

So basically Apache Maven is a project management tool with  a project object model. And it follows a set of standards. And it includes a projects life cycle. And it also act as  a dependency management system. Maven uses logic for executing plugin goals at life cycle phases. 

With Maven your project follow a consistent structure. And your projects are IDE agnostic. Maven allows for easy modification to the project. Maven simplifies the declaration of project dependencies. And it uses a Project Object Model (POM) as mentioned above. 

Installing and configuring Apache Maven. 

Lets look at how to install and configure apache maven in your computer. 

Before all of the bellow steps ensure that you have installed the latest JDK installed in your computer and (Latest Maven package needs java version 1.7 or higher installed) it is pointed to JAVA_HOME environmental variable.

In Windows  

1. Download the Apache Maven package from here or you can visit http://maven.apache.org. 


2. Then unzip the file and copy the unziped file to the program files in C.

C:\Program Files\
    
3. Then go to system variables and add the bellow path to your system variable paths.  

C:/Program Files/apache-maven-3.3.9/bin

4. Then to see whether maven has installed successfully in your computer open up a command prompt and type mvn -v . and it'll print out something like this.


For Unix Based Operating System (Linux, Solaris or Mac OS X)

check environmental variables 

echo $JAVA_HOME


Add your maven package path


export PATH=/opt/apache-maven-3.3.9/bin:$PATH 

After that open up a new terminal and type mvn -v and you'll get something as mentioned above.


If you have any problems feel free to put them on the comment section.