Install and Integrated maven in eclipse
What is maven in eclipse ? Why use it ?
You can search to know more detail about maven. In this article, we only focus basic about maven in eclipse and why use it. Simple, you only know maven is a server includes many libraries for developers need to build projects. When you create project, you can find or download manual in the internet, but this work is very tiring (find and check version), so you only config name and version in file maven, it will auto link to server in the internet to get libraries and save on your local.
Install maven on windows environment
At first, you install java jdk, click here to more detail setup java environment.
You need to download Maven in http://maven.apache.org/download.cgi, select apache-maven-3.3.3-bin.zip for windows.
Open file just download, extract into your folder (exam: D:\java\apache-maven-3.3.3)
Config maven environment: Enter Control panel -> System. On left, click Advanced System Settings. System Properties dialog opening, select Advanced tab -> Environment Variables.
At User variables, you create new variable is :
- Variable name: MAVEN_HOME
- Variable value: path of java that you install above (exam : D:\java\apache-maven-3.3.3)
At System variables:
Edit Path variable: add ;%MAVEN_HOME%\bin; at the end of content Path.
You can reboot computer or log off to variable environment effect.
Check plugin maven in eclipse: open file -> new -> other, select Maven, if have Maven project , Maven module is OK, else if have not maven, you need to install maven as follow: in eclipse -> Help -> Install New Software, click Add button and fill as below:
- Name: maven
- Location: http://download.eclipse.org/technology/m2e/releases
OK and select all, next to install, after that restart Eclipse
Config maven in eclipse
Create folder to storing all libraries that maven auto download from internet. (exam: D:\Maven\Libs). During develop many projects, you have many configurations related to maven, it will download and save on this folder, after that, if have no internet, you can build project do not need internet (run maven offline)
Open setting.xml file in D:\java\apache-maven-3.3.3\conf and add code in setting tag
Open eclipse, window -> Preferences -> Maven -> User Setting, Browser to setting.xml file above (D:\java\apache-maven-3.3.3\conf\settings.xml), click Update Settings, Apply.
In Local Repository (From merged user and global settings) will show as config above (D:\Maven\Libs)
You click Reindex and OK
After integrated maven in eclipse, we develop many projects with spring mvc framework very easy and fast, you can config hibernate, ldap, quartz job, email, connection to database, … without try to search or download libraries from the internet. We will guide step by step to build many basic projects with spring mvc from here and you need to well prepare everything related to spring mvc category that we posted.Tags: eclipse, maven, maven in eclipse