It was introduced before maven The standard directory structure of , Also see maven Core profile for pom.xml file , Parse this configuration file today .
maven This is the core document of the project pom The file , Every project will have one when it is created pom.xml The configuration file , This file is maven Configuration dependency 、 plug-in unit , Access to managing projects and builds , All the configuration will be in this file , So it is necessary to understand the basic configuration of this file .
Here's the picture , List. POM File a series of configuration items .
The following configuration is POM File basic indispensable configuration items .
Let's talk about the most basic configuration items .
modelVersion
maven Model version of , Follow maven Definition , Generally, it can't be modified .
groupId
Organization of the project , It's usually a top-level domain name + Name of company or organization , Such as alibaba The project organization is com.alibaba, If your company's domain name is www.abc.com, Then your project organization is best to com.abc name .
artifactId
Name of the project , It is also an important sign of introducing dependencies between projects . image alibaba There is one dubbo project ,dubbo The project may be associated with many subprojects , therefore artifactId It will be defined as dubbo、dubbo-config Such a project .
version
Version of the project , Project iterative development , It can go through many versions , By this definition , The default is part of the package , Such as dubbo-2.8.4.jar. in addition , The version has two concepts ,0.0.1-SNAPSHOT This is the snapshot version ,0.0.1-RELEASE Or not SNAPSHOT is RELEASE edition .
packaging
Packaging type , There are several types of :pom, jar, maven-plugin, ejb, war, ear, rar, par, Default not to fill in is jar package , What is commonly used is pom、jar、war.
properties
Configure public properties , Such as spring-web,spring-aop You have to rely on these two , They must be the same version as 4.5.0, You can put the version number on the attribute for unified management , It's easy to maintain .
Introduces the most basic configuration items , Other configurations will be broken down later . For more detailed configuration instructions, please refer to the official documentation :
Recent hot article recommends :
1.Java 15 Official release , 14 A new feature , Refresh your mind !!
2. Finally, I got it through open source projects IntelliJ IDEA Activation code , It's delicious !
3. I use Java 8 Wrote a piece of logic , I can't understand it , You try ..
4. To hang up Tomcat ,Undertow It's very powerful !!
5.《Java Development Manual ( Song Mountain version )》 The latest release , Download it quickly !
I think it's good , Don't forget to like it + Forward !