Maven create archetype: Is there a way to declare properties (defaulted to a value) so as not to have them prompted?

落爺英雄遲暮 提交于 2019-12-12 05:29:51

问题


I am working on creating a maven archetype. It is working fine. I have one more enhancement to do which is explained below

In the archetype-metadata.xml, I declared the following properties.

<requiredProperties>
        <requiredProperty key="item1">
            <defaultValue>${artifactId}_1</defaultValue>
        </requiredProperty>
        <requiredProperty key="item2">
            <defaultValue>${artifactId}_2</defaultValue>
        </requiredProperty>
</requiredProperties>

When I create the project, it is prompting for the required properties as it should.

All I need is NOT to prompt for these values (which would force to accept the default values) while creating the project?

So, my question: is there a way to declare properties (defaulted to a value) so as not to have them prompted?

来源:https://stackoverflow.com/questions/34021316/maven-create-archetype-is-there-a-way-to-declare-properties-defaulted-to-a-val

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!