title: maven archetype not replacing properties
body: <p>I'm trying to create a maven archetype to generate a number of projects from a predefined template.</p>
  
  <p>The template project generated by the archetype is a Spring Boot service. The following is the contents of the archetype project folder tree:</p>
  
  <pre><code>my-archetype
  ¦   pom.xml
  ¦
  +---src
  ¦   +---main
  ¦   ¦   +---resources
  ¦   ¦       +---archetype-resources
  ¦   ¦       ¦   ¦   mvnw
  ¦   ¦       ¦   ¦   mvnw.cmd
  ¦   ¦       ¦   ¦   pom.xml
  ¦   ¦       ¦   ¦   rebuild.sh
  ¦   ¦       ¦   ¦
  ¦   ¦       ¦   +---src
  ¦   ¦       ¦       +---main
  ¦   ¦       ¦       ¦   +---docker
  ¦   ¦       ¦       ¦   ¦       Dockerfile
  ¦   ¦       ¦       ¦   ¦
  ¦   ¦       ¦       ¦   +---java
  ¦   ¦       ¦       ¦   ¦       __moduleClassName__ServiceApplication.java
  ¦   ¦       ¦       ¦   ¦       __moduleClassName__ServiceController.java
  ¦   ¦       ¦       ¦   ¦
  ¦   ¦       ¦       ¦   +---resources
  ¦   ¦       ¦       ¦           application.yml
  ¦   ¦       ¦       ¦           bootstrap.yml
  ¦   ¦       ¦       ¦
  ¦   ¦       ¦       +---test
  ¦   ¦       ¦           +---java
  ¦   ¦       ¦                   __moduleClassName__ServiceApplicationTests.java
  ¦   ¦       ¦
  ¦   ¦       +---META-INF
  ¦   ¦           +---maven
  ¦   ¦                   archetype-metadata.xml
  ¦   ¦
  ...
  </code></pre>
  
  <p><code>${moduleClassName}</code> is a custom property defined to allow customization of class names. I install the archetype in my local repository with mvn clean install, then try to create a project from it with <code>mvn archetype:generate ... -DmoduleClassName=&lt;myModule&gt;</code>.</p>
  
  <p>Everything seems to work correctly except that, while the *.java files are correctly named and placed in the correct pacakges (and strings inside them are replaced with property values as well), for other files the replacement doesn't happen. In particular this is the content of <code>src\main\resources\archetype-resources\src\main\resources\bootstrap.yml</code></p>
  
  <pre><code>spring:
      application:
          name: ${project.artifactId}
  </code></pre>
  
  <p>and this is the content of <code>src\main\resources\archetype-resources\src\main\docker\Dockerfile</code></p>
  
  <pre><code>FROM java:8
  VOLUME /tmp
  ADD ${project.artifactId}.jar app.jar
  RUN bash -c 'touch /app.jar'
  ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
  </code></pre>
  
  <p>I would like the <code>${project.artifactId}</code> variable to be replaced in both cases, while it don't happen in the generated project.</p>
  
  <p>These are the relevant parts of my archetype-metadata.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;archetype-descriptor ... &gt;
    &lt;fileSets&gt;
      &lt;fileSet filtered="true" packaged="true" encoding="UTF-8"&gt;
        &lt;directory&gt;src/main/java&lt;/directory&gt;
        &lt;includes&gt;
          &lt;include&gt;**/*.java&lt;/include&gt;
        &lt;/includes&gt;
      &lt;/fileSet&gt;
      &lt;fileSet filtered="true" encoding="UTF-8"&gt;
        &lt;directory&gt;src/main/docker&lt;/directory&gt;
        &lt;includes&gt;
          &lt;include&gt;**/Dockerfile&lt;/include&gt;
        &lt;/includes&gt;
      &lt;/fileSet&gt;
      &lt;fileSet filtered="true" encoding="UTF-8"&gt;
        &lt;directory&gt;src/main/resources&lt;/directory&gt;
        &lt;includes&gt;
          &lt;include&gt;**/*.yml&lt;/include&gt;
        &lt;/includes&gt;
      &lt;/fileSet&gt;
      &lt;fileSet filtered="true" packaged="true" encoding="UTF-8"&gt;
        &lt;directory&gt;src/test/java&lt;/directory&gt;
        &lt;includes&gt;
          &lt;include&gt;**/*.java&lt;/include&gt;
        &lt;/includes&gt;
      &lt;/fileSet&gt;
      .
      .
      .
    &lt;/fileSets&gt;
    &lt;requiredProperties&gt;
        &lt;requiredProperty key="moduleClassName"/&gt;
    &lt;/requiredProperties&gt;
  &lt;/archetype-descriptor&gt;
  </code></pre>