Maven What is it? ？
I didn't touch... In some time before college maven This thing , Now I'm getting to know something about maven Project , We need to learn it systematically , So let's start with understanding its function ！
- Maven yes apache The next open source project , Is pure Java Developed and used only for management Java project ;
The above is a more official statement , What is the specific situation ？
In layman's terms , When we have more than one project, there will be more shelving packages referenced , And there will be a high repetition rate , You have to manually import all kinds of jar package , This is not friendly for practical operation , and maven This thing is to solve this problem ,maven This middleware design concept is equivalent to a warehouse , There are all kinds of shelf bags in the warehouse , For every need jar File to call jar file ;
Maven Use conventions in , Appointment java Which directory must source code be placed in , compiled java What directory must the code be placed in , There is a clear agreement in these catalogues , For the cooperative development of the project 、 Later maintenance is very convenient ;
Maven Every action has a life cycle , For example, to perform mvn install You can do the compilation automatically , test , Packaging and other construction processes （maven It has its own set of operating commands , Simple and practical ）
I just need to define one pom.xml, Then put the source code in the default directory ,Maven Help us with other things , A lot of questions have been omitted for us , We don't need to pay too much attention to other issues besides development ;
Use Maven You can build projects with a high degree of Automation , Dependency management ( This is the use of Maven The biggest benefit ), Warehouse management .
Applied to large projects ,maven Sub module development , Improve development efficiency .
Use it again maven It's mentioned in the benefits of , Let's talk about it in detail ;
Dependency means jar Interdependence between packages , For example, let's build a Struts2 When developing a framework for , Only have struts2-core-184.108.40.206.jar This jar You can't have a bag ,struts2-core-220.127.116.11.jar It depends on other things jar package , Dependency management refers to the use of Maven To manage the jar package ,Maven The way of management is “ Automatically download what the project needs jar package , Unified management jar Dependencies between packages ”.
The project construction process includes 【 Clean up the project 】→【 Compile the project 】→【 Test project 】→【 Generate test reports 】→【 Packaging project 】→【 Deployment project 】 These steps , These six steps are the complete construction process of a project .
I mentioned before maven The operation command of can be used in this process , Just use the command , For example, one click to start a project ：Tomcat:run： You can run the project directly ;
本文为[Tomorrow is not the day]所创，转载请带上原文链接，感谢