First, Maven brief introduction
MAVEN is a project management tool for project building (mvn clean install), dependency management (central Warehouse, Nexus) and project information management based on the Java platform.
MAVEN is based on the Project object Model (POM). Is declarative, the work required by the project build process and all phases of the process is implemented by the plug-in. And most of the plugins are ready-made. Developers simply need to declare the basic elements of the project, and Maven runs the built-in, complete build process. This is largely eliminated by repetition. Here you can control both make and ant, both of which are procedural, and developers need to display a specified target. and the tasks that need to be run to complete the goal. For each project. Developers need to write this process again.
Ii. Construction of the project
1. Download maven
From the official website (http://maven.apache.org/download.cgi#) Download the name of "Apache-maven-3.3.3-bin.zip" compressed package, extracted to the C drive.
Folder results
2. Create a local warehouse
The default local warehouse location for Maven is ". M2/repository" under the current user's working folder, which will cause more and more files in this folder during use. Occupy more and more space, so generally we will change to other disk folder. Need to do two steps. The first step. In the D-disk build folder for storing files (here I have created "D:\maven-3.3.3-bobo\repository" this path file), the second step. In the Conf folder in the MAVEN uncompressed file, change the settings file. Add this sentence
<localRepository>D:\maven-3.3.3-bobo\repository</localRepository> |
3. Configuring Maven in Eclipse
Open "Window→preferences→maven", select Installations, and click "Add" to select the extracted Maven path.
Tick the path you need to use.
Then, click "User Settings", in the golbalsettings and user Settings, select the Settings file under the Conf directory.
Click on the "Updatesettings" button.
4. How to create a maven project with eclipse
Right-click to select New→other→maven→next
→next
→next
The basic structure of the MAVEN project:
Third, summary
In this article, however, I made a brief description of how to build a Maven project in Eclipse, although I've been working with Maven for a long time, but like Maven, which is basically custom-built and has a high-speed development manual, I feel a little bit confused about Maven, Find out the time these two days. A special study. I don't know where to start next time we don't have a problem. Tomorrow will continue to share with you my study maven some of the knowledge points, welcome all kinds of shooting bricks!
Maven Project Build-eclipse version