Minimal POM

Minimal POM
The minimum requirement for a POM are the following:

project root
modelVersion - should be set to 4.0.0
groupId - the id of the project's group.
artifactId - the id of the artifact (project)
version - the version of the artifact under the specified group

Here's an example:

< project >
   
< modelVersion > 4.0.0 </ modelVersion >   
   
< groupId > com.juvenxu.mvnbook </ groupId >   
   
< artifactId > hello-world </ artifactId >   
   
< version > 1.0-SNAPSHOT </ version >   
</ project >   

A POM requires that its groupId, artifactId, and version be configured. These three values form the project's fully qualified artifact name.

modelVersion指定了当前POM模型的版本,对于Maven2及Maven 3来说,它只能是4.0.0
groupId定义了项目属于哪个组,这个组往往和项目所在的组织或公司存在关联,如果你的公司是mycom,有一个项目为myapp,那么groupId就应该是com.mycom.myapp
artifactId定义了当前Maven项目在组中唯一的ID
version指定了项目当前的版本,SNAPSHOT意为快照,说明该项目还处于开发中,是不稳定的版本
此外,如果配置的其他细节没有被指定,Maven会使用它们的默认值
Furthermore,你可以看到,在Minimal POM中未指定仓库,如果你的项目是采用最小的pom,那么它是会继承所谓的Super POM,所以就算你没有指定仓库,maven也知道所有的依赖直接从网上(http://repo1.maven.org/maven2)下载



你可能感兴趣的:(Minimal POM)