一个Maven个人资料可以从另一个Maven个人资料继承吗? [英] Can a maven profile inherit from another maven profile?

查看:101
本文介绍了一个Maven个人资料可以从另一个Maven个人资料继承吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个几乎完全相同的配置文件.我不想在每个配置文件中重复配置,而是希望一个配置文件从另一个配置文件继承",但是我看不到使用maven 3进行此操作的明显方法.

I have two profiles that are nearly identical. Rather than duplicating the configuration in each, I'd like for one profile to "inherit" from the other, but I don't see an obvious way to do this using maven 3.

在Maven中可以继承配置文件吗?

Is profile inheritance possible in maven?

推荐答案

否,无法继承配置文件.

No, profiles cannot be inherited.

但是,您可以有多个活动配置文件,这可以通过将两个配置文件中的公共元素分解为第三个配置文件来实现大致相同的目的,而每当您激活其他两个配置文件之一时,您都会激活该配置文件.

However, you can have multiple active profiles, which could allow you to accomplish roughly the same thing by factoring out the common elements in the two profiles into a third profile that you activate whenever you activate one of the other two profiles.

这篇关于一个Maven个人资料可以从另一个Maven个人资料继承吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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