Using maven archetype template variables inside javascript files

Paul McLoughlin :

I'm creating a Maven archetype that includes a javascript file. I would like to use the ${package} and ${artifactId} template variables inside my javascript file. Is this possible?

When I then generate a project from the archetype, the javascript file still includes the ${package} rather than the value of package.

Here is the relevant part of my archetype-metadata.xml

<fileSets>
  <fileSet encoding="UTF-8">
        <directory></directory>
        <includes>
            <include>**/*.json</include>
            <include>**/*.js</include>
            <include>**/*.lock</include>
            <include>.eslintignore</include>
            <include>.gitignore</include>
        </includes>
    </fileSet>
</fileSets>
JF Meier :

You need to set filtered to true on the fileSet.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=27045&siteId=1