[Maven] The Super POM
与面向对象编程中的对象继承类似,扩展父 POM 的 POM 从该父 POM 继承某些值。此外,正如 Java 对象最终继承自 一样java.lang.Object,所有项目对象模型都继承自基础 Super POM。下面的代码片段是 Maven 3.5.4 的 Super POM。
<project><modelVersion>4.0.0</modelVersion><repositories><repository><id>central</id><name>Central Repository</name><url>https://repo.maven.apache.org/maven2</url><layout>default</layout><snapshots><enabled>false</enabled></snapshots></repository></repositories><pluginRepositories><pluginRepository><id>central</id><name>Central Repository</name><url>https://repo.maven.apache.org/maven2</url><layout>default</layout><snapshots><enabled>false</enabled></snapshots><releases><updatePolicy>never</updatePolicy></releases></pluginRepository></pluginRepositories><build><directory>${project.basedir}/target</directory><outputDirectory>${project.build.directory}/classes</outputDirectory><finalName>${project.artifactId}-${project.version}</finalName><testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory><sourceDirectory>${project.basedir}/src/main/java</sourceDirectory><scriptSourceDirectory>${project.basedir}/src/main/scripts</scriptSourceDirectory><testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory><resources><resource><directory>${project.basedir}/src/main/resources</directory></resource></resources><testResources><testResource><directory>${project.basedir}/src/test/resources</directory></testResource></testResources><pluginManagement><!-- NOTE: These plugins will be removed from future versions of the super POM --><!-- They are kept for the moment as they are very unlikely to conflict with lifecycle mappings (MNG-4453) --><plugins><plugin><artifactId>maven-antrun-plugin</artifactId><version>1.3</version></plugin><plugin><artifactId>maven-assembly-plugin</artifactId><version>2.2-beta-5</version></plugin><plugin><artifactId>maven-dependency-plugin</artifactId><version>2.8</version></plugin><plugin><artifactId>maven-release-plugin</artifactId><version>2.5.3</version></plugin></plugins></pluginManagement></build><reporting><outputDirectory>${project.build.directory}/site</outputDirectory></reporting><profiles><!-- NOTE: The release profile will be removed from future versions of the super POM --><profile><id>release-profile</id><activation><property><name>performRelease</name><value>true</value></property></activation><build><plugins><plugin><inherited>true</inherited><artifactId>maven-source-plugin</artifactId><executions><execution><id>attach-sources</id><goals><goal>jar-no-fork</goal></goals></execution></executions></plugin><plugin><inherited>true</inherited><artifactId>maven-javadoc-plugin</artifactId><executions><execution><id>attach-javadocs</id><goals><goal>jar</goal></goals></execution></executions></plugin><plugin><inherited>true</inherited><artifactId>maven-deploy-plugin</artifactId><configuration><updateReleaseInfo>true</updateReleaseInfo></configuration></plugin></plugins></build></profile></profiles></project>
您可以通过创建一个最小的pom.xml并在命令行上执行来查看 Super POM 如何影响您的项目对象模型:mvn help:effective-pom
参考:
Maven:The Super POM
[Maven] The Super POM相关推荐
- 包继承Maven的超级POM
本篇文章是一篇关于包继承的帖子 就像Java中的类隐式继承Object一样,对于pom.xml来说,它隐式继承超等POM. 针对Maven3来说,该超等POM位于maven-model-builder ...
- 报错: eclipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:2.3.2...
错误信息出现在pom头的project标签,project标签内容是 <project xmlns="http://maven.apache.org/POM/4.0.0" x ...
- Maven的配置文件pom.xml
简介: 什么是POM? POM是项目对象模型(Project Object Model)的简称,它是Maven项目中的文件,使用XML表示,名称叫做pom.xml.在Maven中,当谈到Project ...
- maven项目的pom.xml 标签的含义
下面是我新建一个maven项目后生产的pom.xml <?xml version="1.0" encoding="UTF-8"?> <proj ...
- SSM整合时Maven项目的pom.xml版本兼容的代码备份
场景 jdk:1.8 Tomcat:7.0 本地mysql:8.0 Eclipse:Eclipse Jee Photon Spring:4.3.8 AOP:1.8.0 mybatis:3.3.0 My ...
- 【报错笔记】Eclipse导入Maven项目时pom.xml报错,项目上有红感叹号。
Eclipse导入Maven项目时pom.xml报错,项目上有红感叹号. 错误原因: pom.xml中依赖的jar包在本地仓库中不存在,但是在maven/conf/settings.xml中定义了阿里 ...
- Maven 中的pom.xml文件
Maven中的Pom.xml文件解析 项目管理利器(Maven)--Pom.xml解析<name>项目的描述名</name> <url>项目的地址</url& ...
- JAVA项目怎么不是蓝色_解决IDEA创建maven项目时pom.xml没有变蓝的问题
如下所示: 选中pom.xml,右键点击add as maven project, 稍等片刻后就可以了 补充知识:Idea导入maven项目不自动识别pom.xml *Idea导入maven项目不自动 ...
- Maven精选系列--POM文件解析
转载自 Maven精选系列--POM文件解析 之前有介绍到maven的标准目录结构,也看到了maven的核心配置文件pom.xml文件,今天就解析这个配置文件. maven工程的核心文件就是这个pom ...
最新文章
- .NET 4.5 基类库中的新增功能
- shopify api php 开发,Shopify插件开发基础篇-获取店铺信息
- bazel编译tensorflow 生成libtensorflow_inference.so 和 libandroid_tensorflow_inference_java.jar
- 「消息队列」看过来!
- expsky.php,Typecho漏洞利用工具首发,半分钟完成渗透
- 自然语言处理中的Attention Model:是什么以及为什么[一]
- POJ 3660 Cow Contest(传递闭包floyed算法)
- Leetcode--191. 位1的个数
- 【零基础学Java】—Socket类(五十五)
- 计算机黑龙江省二级c语言题库,计算机二级c语言题库
- html静态网页制作天天生鲜,天天生鲜 前后台资源
- android仿微信图片编辑库,Android仿微信朋友圈添加图片
- 提问的力量(一):提问在学习中的价值
- 软件编程推荐书籍 大全
- G. 打印 LOGO(递归)
- 加密狗在虚拟服务器上怎么注册,您好 我想问下 在虚拟机里面安装软件 装好后要进行加密狗注册 加密狗插进去显示安装成功 可是点击注册就提示检测不到加密锁 是什么原因呢?急急急...
- 如何安装ruby、rails
- Java中四个访问修饰符public private protected 和默认(package-private)的用法详解
- PC端下载B站和yotube视频的简单方法: you-get
- 06 现有原件模型的创建