views:

138

answers:

1

We are using a Maven archetype to create an initial setup for projects using our framework, which relies heavily on Freemarker. As a consequence we need to copy a few Freemarker templates when the archetype is used to generate a new project.

The problem we ran into is that Maven seems to run Velocity on all of the files listed as resources. Velocity tries to interpret our Freemarker code and fails, so we need to use escapes in many places.

Is there a way to tell Maven to just copy the files? We don't want the Velocity engine to run at all for our files.

+1  A: 

Using src/main/resources/META-INF/maven/archetype-metadata.xml:

<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor name="foo-archetype">
  <fileSets>
    <fileSet filtered="false" encoding="UTF-8">
      <directory>src/foo</directory>
      <includes>
        <include>**/*.ftl</include>
      </includes>
    </fileSet>
  </fileSets>
</archetype-descriptor>

Source: http://maven.apache.org/plugins/maven-archetype-plugin/specification/archetype-metadata.html

Charles Brooking