开发者

Is there a way to just copy resources when using a Maven archetype (no Velocity)?

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 ne开发者_运维技巧w 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜