Peter Niederwieser wrote
>
>
>
>> Is there a way to dynamically grab the file and directly insert it into
>> the war at build time without copying it to WEB-INF?
>>
>
> Sure. See the War plugin chapter in the Gradle user guide:
> http://gradle.org/docs/current/userguide/userguide_single.html#sec:customizing
>
Thanks, that was the tip I needed. I did the following:
<code>
war {
webInf {
from 'datasource'
include(datasource + '.xml')
rename(datasource + '.xml', 'iq-datasource.xml')
from('security/')
include(security + '.xml')
rename(security + '.xml', 'iq-security.xml')
}
}
</code>
> On a closely related note, gradle continues to run quietly if the file
> called for doesn't exist. I don't know the reason for this, but it
> certainly is unexpected behavior considering that if you try to copy a
> file in JAVA that doesn't exist you get a big ugly FileNotFoundException.
> Is this a gradle bug, or is this some kind of deliberate behavior? How do
> we get around it?
>
I think it is deliberate. One way to get around it is to use `Copy.eachFile
{}` to check which files are actually copied, and to compare that against
your expectations.
So since I'm not actually using the Copy() functionality anymore, is there a
way to assert that the requested file exists in the war task? A flag I can
set? A hack I can implement in a doFirst clause?
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Copy-file-into-WEB-INF-fail-if-not-exists-tp5709846p5709852.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email