Maven - what is maven - Maven Tutorial for Beginners - maven tutorial
maven tutorial tags : apache maven , maven repository , maven central
Introduction
- We must first ensure that you have installed Maven into Eclipse
learn maven tutorial - Maven Introduction - maven example
- This is the image after Project completion:
learn maven tutorial - project explorer - maven example
Create Maven Project
- In Eclipse, Click "New/Other"
learn maven tutorial - Create Maven Project - maven example
learn maven tutorial - Create Maven Project step 1 - maven example
learn maven tutorial - Create Maven Project step 2 - maven example
learn maven tutorial - Create Maven Project step 3 - maven example
- Open pom.xml file to configure the library will use
- Create class CheckNumeric.java
learn maven tutorial - Configure Maven - maven example
CheckNumeric.java
Output
learn maven tutorial - Configure Maven step 1 - maven example
- You can clearly see your project using the library. Where is its location on the hard drive.
learn maven tutorial - Configure Maven step 2 - maven example
Installation Project with Maven
- Here is compile and pack your Project by Maven
learn maven tutorial - Installation Project With Maven - maven example
learn maven tutorial -Installation Project With Maven step 1 - maven example
learn maven tutorial - Installation Project With Maven step 2- maven example
maven tutorial tags : apache maven , maven repository , maven central
Explain the operating principles of Maven
- Above you have created the project and ran flawlessly. The Project using StringUtils class, which to be a class of Apache, and not in the standard library of JDK. Traditionally you have to copy this library to project and declare the classpath.
- However, the guidelines do not have to copy and declare classpath as the traditional way. The library was managed by Maven management. Now we will explain how Maven works:
learn maven tutorial - Operating Principles of Maven - maven example
- The illustration above shows how the Maven done.
- You declare in pom.xml, that project depend on common-lang3 library version 3.3.2.
- As soon as you SAVE pom.xml file, Maven will check if this library has local repository on your computer yet. If has no, Maven will download it from the repository in the internet.
- Finally, Maven will automatically declare Classpath.
View Local repository
- Your question is where local repository located?
learn maven tutorial - View Local Repository - maven example
learn maven tutorial - View Local Repository step 1 - maven example
learn maven tutorial - View Local Repository step 2- maven example
learn maven tutorial - View Local Repository step 3 - maven example
learn maven tutorial - View Local Repository step 4 - maven example
learn maven tutorial - View Local Repository step 5 - maven example
learn maven tutorial - View Local Repository step 6 - maven example
learn maven tutorial - View Local Repository step 7 - maven example
View Maven Repository on Internet
- The question is where to lookup the information groupId, artifactId and version.
- You can go to one of these sites:
- http://search.maven.org
- http://mvnrepository.com
learn maven tutorial - Maven Central Repository - maven example
learn maven tutorial - Maven Central Repository step 1- maven example
learn maven tutorial - Maven Central Repository step 2- maven example
Configuring Maven download source and javadoc
- Normally Maven only download binary files. To Maven download the source and javadoc, you need to configure on Eclipse.
- Windows/Preferences
learn maven tutorial - Maven Central Repository step 3 - maven example
- Change something in the pom.xml file and save (Or build project), Maven will download the source and javadoc.
- The results you see on the Local Repository:
learn maven tutorial - Maven Central Repository step 4 - maven example