Maven包含另一个用于插件配置的pom [英] Maven include another pom for plugin configuration

查看:269
本文介绍了Maven包含另一个用于插件配置的pom的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在行家pom中包含其他pom或信息?

is there a way to include another pom or information in a maven pom ?

我有几个基本不相关的pom或具有不同的父pom.但是,对于包装,要求清单与所有项目相同.

I have several poms which are basically not related or have different parent poms. Nevertheless for packaging it is required to have a Manifest identical to all projects.

所以目前我有一个pom:

So currently I have in a pom:

<plugin>
  <artifactId>maven-assembly-plugin>
   <!--- .... -->
    <archive>
      <manifestEntries>
        <build-date>....</build-date>
        <build-nr>.....</build-nr>

等等等

我想避免将此配置粘贴到所有的pom中.

I would like to avoid to paste this configuration to all severall poms.

那么如何在不继承的情况下共享插件的配置?

So how can I share the configuration of a plugin without inheritance ?

谢谢

推荐答案

一种方法是使用pluginManagement部分.可以在本节的父pom中定义plugin配置,这些配置可用于继承的pom,使其按原样使用或被覆盖.

One way to do this is using pluginManagement section. plugin configurations can be defined in this section in a parent pom and will be available to inherited poms to be used as is or overridden.

此处是相关的maven文档.在您的特定情况下,您需要适当地组织项目/小游戏.

Here is the relevant maven documentation. In your specific case, you would need to organize your projects/poms suitably.

这篇关于Maven包含另一个用于插件配置的pom的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆