Stuart McCulloch wrote:
On 23/02/2008, Laurie Harper <[EMAIL PROTECTED]> wrote:
Stuart McCulloch wrote:
On 20/02/2008, Laurie Harper <[EMAIL PROTECTED]> wrote:
How do I package resources in an archetype so that they don't get
filtered through Velocity when the archetype is used? Currently
Velocity
is choking on Javascript files contained in the archetype, and I'd
rather not have to modify all the Javascript files so they will pass
through Velocity without error (the archetype is packaging third-party
code I don't want to modify).

perhaps you could try adding:

   #literal()

to the start of the file, and:

   #end

to the end of the file - any text between should be copied literally by
Velocity

That doesn't really avoid modifying the files though... and it's not
clear to me that it'd help in all cases (e.g. binary file types, if
Maven/Velocity isn't already smart enough to skip them, or any file
where stray whitespace at the start is an issue, etc...)

The 'obvious' solution I tried (w/out success) was to specify the
archetype resources in the same way I would in a POM in the same
situation:

   <resources>
     <filtering>false</filtering>
     <includes>
       <resource>src/main/webapp/...</resource>
       ...

but unfortunately that doesn't seem to work in archetype.xml. Any other
possibilities?


have you tried setting the "filtered" attribute for the particular resource
entry, ie:

  <resources>
    <resource>src/main/resources/readme.txt</resource>
    <resource filtered="false">src/main/resources/BINARY</resource>
  </resources>

that's worked for me in the past when I want to exclude binary files from
filtering

Just tried it, but it doesn't seem to have any effect :-( I guess I need to start digging through the archetype plugin code...

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to