Maven_Life Cycle and Conceptual Model_hehe.employment.over.24.4

24.8 Maven_Life Cycle

  • Maven divides the project construction process into three sets of mutually independent life cycles. Please note that we are talking about "three sets" and "independent of each other". The three sets of life cycles are:
    • Clean Lifecycle : Do some things before doing the real buildClean up
    • Default Lifecycle : The core part of the construction,Compile, test, package, deployand many more.
    • Site LifecycleGenerate project reports, sites, publish sites
  • Icon:
    Insert picture description here

24.9 Maven_Conceptual Model

  • Maven includes a Project Object Model (Project Object Model), a set of standard sets, a Project Lifecycle (Project Lifecycle), a Dependency Management System (Dependency Management System), and is used to run definitions in the life cycle phase (phase) The logic of the plugin goal.
    Insert picture description here
  • Project Object Model
    • A maven project has a pom.xml file, which defines the coordinates of the project, project dependencies, project information, plug-in goals, etc. through the pom.xml file.
  • Dependency Management System
    • Unified management of the jar packages that the project depends on through maven's dependency management. For example, if the project depends on junit4.9, you can use junit4.9 by defining the dependency of junit4.9 in pom.xml. The following is the dependency definition of junit4.9:
<!-- 依赖关系 -->
<dependencies>
	<!-- 此项目运行使用 junit,所以此项目依赖 junit -->
	<dependency>
		<!-- junit 的项目名称 -->
		<groupId>junit</groupId>
		<!-- junit 的模块名称 -->
		<artifactId>junit</artifactId>
		<!-- junit 版本 -->
		<version>4.9</version>
		<!-- 依赖范围:单元测试时使用 junit -->
		<scope>test</scope>
	</dependency>
  • A project lifecycle (Project Lifecycle)
    • Use maven to complete the construction of the project. The project construction includes the processes of cleaning, compiling, testing, and deploying. Maven standardizes these processes into a life cycle. The stages of the life cycle are as follows:
      Insert picture description here
  • A set of standards
    • maven willThe entire project management processdefinitionA set of standardsFor example, the project built by maven has a standard directory structure, a standard life cycle stage, and a standard coordinate definition for dependency management.
  • Plugin goal
    • The maven management project life cycle process is based on plug-ins.

Guess you like

Origin blog.csdn.net/qq_44686266/article/details/113858288