-->

Maven create archetype: Is there a way to declare

2019-09-10 22:05发布

问题:

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?