【问题标题】:Maven active profiles source externalMaven 活动配置文件源外部
【发布时间】:2015-11-21 19:09:32
【问题描述】:

当我尝试为我的 maven 项目获取活动配置文件时,我输入:

mvn help:active-profiles

正如文档所述 (http://maven.apache.org/guides/introduction/introduction-to-profiles.html) 但这就是我得到的:

Active Profiles for Project 'com.mycompany.app:my-app:jar:1.0-SNAPSHOT': 

The following profiles are active:

- testProfile (source: external)

(来源:外部)是什么意思?因为我在 .m2 文件夹中的 settings.xml 文件上设置了配置文件,所以根据文档应该是:

(source: settings.xml)

【问题讨论】:

    标签: java maven configuration settings profile


    【解决方案1】:

    源是定义配置文件的位置。 Source external表示配置文件定义在settings.xml或profiles.xml中。

    阅读this 文章。相关部分是:“我如何知道在构建过程中哪些配置文件有效?” 来源可以是项目的 pom.xml,父项目 @987654323 @ 或 maven settings.xml.

    【讨论】:

    • 链接和我发的一样。但是文章中仍然没有说有“外部”选项,它只说源应该是 pom.xml 或 settings.xml。这让我感到困惑,“外部”是什么意思?
    • 从答案中引用:“外部源意味着配置文件是在 settings.xml 或 profiles.xml 中定义的”。在文档中搜索“外部文件中的配置文件”
    • 这听起来是真的,但它不应该说“settings.xml”而不是 external 吗?就像在示例中一样。
    猜你喜欢
    • 2021-01-08
    • 2019-05-17
    • 1970-01-01
    • 2017-07-12
    • 2014-10-14
    • 2017-01-24
    • 2017-04-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多