Hits: 739
Three types of projects in Maven:
1.pom Engineering: Used in parent engineering or aggregation engineering. The version control used to make the jar package.
2.war Engineering: A project that will be packaged into a war and published on a server. such as websites or services.
3.jar Engineering: It will be packaged as a jar for use as a jar package.
Take Amoy Mall as an example:
I. POM ENGINEERING
1. Taotao-parent:
Taotao-parent is the parent project of the whole project and it is a POM project. The version control used to do the entire project, that is, all the versions of the jar packages to be used in the project are centrally managed by the parent project. This way you do not need to write a version number when you write Maven dependencies on other engineering pom files. Of course, all projects have to inherit it first.
2.taotao-manager:
Create Taotao-manager to do the polymerization project, it is also a pom project. Create four model Taotao-manager-pojo,taotao-manager-dao,taotao-manager-service,taotao-manager-web, respectively, It also automatically generates 4 independent MAVEN projects. Aggregation engineering is just a tool to help other modules build, and there is no real content in itself. The specific code of each project is written in the generated project.
2.1. The significance of using the aggregation engineering Taotao-manager is that these modules are also a separate project and now aggregate them into Taotao-manager so that when we build the project, we just build taotao-manager one. All we need to do is build this aggregation project Taotao-manager with Maven instead of worrying about the building of the module, like install Taotao-manager just install it. In short, simplify the operation. The normal coding work is still in the corresponding taotao-manager-pojo,taotao-manager-dao,taotao-manager-service,taotao-manager-web. In the project.
Two. War Project
1.taotao-rest,taotao-portal these
These projects are to be deployed on the server, so they are packaged into a war form. Some of these projects are accessed directly by the user through the browser, or by other projects through the Publishing service.
Three. Jar Engineering
3.taotao-common
This is the project packaged into jars. It is the class, the tool class, that will be used to store some other projects. We can refer to it in the Pom file of other projects, and it makes no difference to reference other jar packages.
<dependency>
<groupId>com.taotao</groupId>
<artifactId>taotao-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
MAVEN's three engineering Pom, jar, war