本文介绍了pom.xml和Apache Maven中的有效pom有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以向我解释一下,apache maven项目中的pom.xml文件和有效的pom.xml文件有什么区别?

Could somebody explain to me, what are are differences between the file pom.xml and the file effective pom.xml in an apache maven project?

推荐答案

超级POM

所有Maven项目POM都扩展了Super POM,它定义了所有项目共享的一组默认值.

The Super POM

All Maven project POMs extend the Super POM, which defines a set of defaults shared by all projects.

所有Maven POM都从Super POM继承默认值.如果您只是编写一个从src/main/java中的某个源生成JAR的简单项目,想要在src/test/java中运行JUnit测试,并且想要使用mvn网站来构建项目站点,则不需要必须自定义任何内容.在这种情况下,您所需要的就是最简单的POM"中显示的最简单的POM.该POM定义了groupId,artifactId和版本:每个项目所需的三个坐标.

All Maven POMs inherit defaults from the Super POM. If you are just writing a simple project that produces a JAR from some source in src/main/java, want to run your JUnit tests in src/test/java, and want to build a project site using mvn site, you don’t have to customize anything. All you would need, in this case, is the simplest possible POM shown in The Simplest POM. This POM defines a groupId, artifactId, and version: the three required coordinates for every project.

超级POM和最简单的POM中的POM之间的合并.

The merge between the Super POM and the POM from The Simplest POM.

**此信息是从以下链接中提取的(该链接中的解释非常完整)

**This info was extracted from the following link (in the link the explanation is very complete)

http://books.sonatype.com/mvnref-book/reference/pom-relationships-sect-pom.html

这篇关于pom.xml和Apache Maven中的有效pom有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 05:28