【问题标题】:Maven custom archetype: Is there a way to have properties not prompted to the user?Maven 自定义原型:有没有办法不向用户提示属性?
【发布时间】:2017-11-17 08:53:54
【问题描述】:

所以我正在做一个原型,我想使用一些属性,但不希望它们被提示给用户。

例如,我有这个代码:

    <requiredProperty key="grupo">
        <defaultValue>${artifactId.substring(0,8).toLowerCase()}</defaultValue>
    </requiredProperty>

我想为参数 grupo 使用 defaultValue,而不要求用户接受它作为默认值。

这个问题已经被问过:Maven create archetype: Is there a way to declare properties (defaulted to a value) so as not to have them prompted? 但没有回答。

非常感谢您的宝贵时间

【问题讨论】:

  • 您找到解决方案了吗?

标签: java maven maven-archetype


【解决方案1】:

您似乎实际上无法做到这一点:https://maven.apache.org/archetype/archetype-models/archetype-descriptor/archetype-descriptor.html#class_requiredProperty

根据文档,您可以指定默认或验证正则表达式。如果它们被声明,您将被提示默认值。

【讨论】:

    猜你喜欢
    • 2021-12-07
    • 1970-01-01
    • 1970-01-01
    • 2016-08-25
    • 2012-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-12
    相关资源
    最近更新 更多