Maven archetype plugin doesn’t let .resources in archetype-resources through

The bug seems to be still present in the maven-archetype-plugin v3.0.1 .
For those who do not want to downgrade the maven-resource-plugin. I managed to establish a more or less ugly workaround.

First you rename the archetype-resources/.gitignore to

__gitignore__

then inside the archetype-metadata.xml add

<requiredProperties>
    <requiredProperty key="gitignore">
        <defaultValue>.gitignore</defaultValue>
    </requiredProperty>
</requiredProperties>

<fileSets>
    <fileSet>
        <directory></directory>
        <includes>
            <include>__gitignore__</include>
        </includes>
    </fileSet>
</fileSets>

When the archetype is generated maven will now first copy the __gitignore__ then sees the __[file]__ syntax and will replace it with the default value “.gitignore”

Leave a Comment

tech