Hi,

I am using the war plugin for a project, and I am trying to add some files to 
the war file's WEB-INF/classes directory. The files I'm targeting exist within 
the project, but outside the webAppDirName for the war. I do not want to add 
the entire directory tree since there are subdirectories that should not be 
included. My war task config looks like:

war {
    classpath fileTree(dir: 'src/conf', include: '*')
}

The files in src/conf are .properties files (ie, not .zip or .jar). These files 
end up in the WEB-INF/lib directory of the war file, not the WEB-INF/classes 
dir.  The docs for the war task say:

Any JAR or ZIP files in this classpath are included in the WEB-INF/lib 
directory. Any directories in this classpath are included in the 
WEB-INF/classes directory.

It doesn't say what happens to files that are not JAR or ZIP files. But it 
appears *any* file added to the classpath ends up in the WEB-INF/lib directory. 
 I get the same results with any of the following two variations:

war {
          classpath fileTree(dir: 'src/conf', include: '*').files
}

war {
          fileTree(dir: 'src/conf', include: '*').each {
                   classpath it
          }
}

The following variation works in that it puts the files under WEB-INF/classes, 
but it includes the subdirectories as well.

war {
          classpath 'src/conf'
}

The behavior is consistent in that whenever I specify the directory (without 
restricting it from being recursive), the files (including subdirectories) end 
up in WEB-INF/classes. In all cases when I restrict the file selection to just 
the base directory (not rescursive), then they end up in WEB-INF/lib.

Am I correct in thinking this is a bug? I plan to create a JIRA issue for this, 
but I wanted to run it by this group first for input.

Thanks,

Darren Evenson
Director of IT
ClickIQ, Inc.<http://www.clickiqinc.com/>


Reply via email to