@@ -103,7 +103,7 @@ target (war: "The implementation target") {
103
103
104
104
event(" StatusUpdate" , [" Building WAR file" ])
105
105
106
- ant. copy(todir :stagingDir, overwrite :true ) {
106
+ ant. copy(todir :stagingDir, overwrite :true , preservelastmodified : true ) {
107
107
// Allow the application to override the step that copies
108
108
// 'web-app' to the staging directory.
109
109
if (buildConfig. grails. war. copyToWebApp instanceof Closure ) {
@@ -119,7 +119,7 @@ target (war: "The implementation target") {
119
119
// package plugin js/etc.
120
120
packagePluginsForWar(stagingDir)
121
121
122
- ant. copy(todir : " ${ stagingDir} /WEB-INF/grails-app" , overwrite : true ) {
122
+ ant. copy(todir : " ${ stagingDir} /WEB-INF/grails-app" , overwrite : true , preservelastmodified : true ) {
123
123
fileset(dir : " ${ basedir} /grails-app" , includes : " views/**" )
124
124
fileset(dir : " ${ resourcesDirPath} /grails-app" , includes : " i18n/**" )
125
125
}
@@ -131,21 +131,21 @@ target (war: "The implementation target") {
131
131
exclude(name :" spring/*" )
132
132
}
133
133
134
- ant. copy(todir :" ${ stagingDir} /WEB-INF/classes" ) {
134
+ ant. copy(todir :" ${ stagingDir} /WEB-INF/classes" , preservelastmodified : true ) {
135
135
fileset(dir :pluginClassesDirPath, classesDirExcludes)
136
136
}
137
137
138
- ant. copy(todir :" ${ stagingDir} /WEB-INF/classes" , overwrite :true ) {
138
+ ant. copy(todir :" ${ stagingDir} /WEB-INF/classes" , overwrite :true , preservelastmodified : true ) {
139
139
fileset(dir :classesDirPath, classesDirExcludes)
140
140
}
141
141
142
142
ant. mkdir(dir :" ${ stagingDir} /WEB-INF/spring" )
143
143
144
- ant. copy(todir :" ${ stagingDir} /WEB-INF/spring" ) {
144
+ ant. copy(todir :" ${ stagingDir} /WEB-INF/spring" , preservelastmodified : true ) {
145
145
fileset(dir :" ${ basedir} /grails-app/conf/spring" , includes :" **/*.xml" )
146
146
}
147
147
148
- ant. copy(todir :" ${ stagingDir} /WEB-INF/classes" , failonerror :false ) {
148
+ ant. copy(todir :" ${ stagingDir} /WEB-INF/classes" , failonerror :false , preservelastmodified : true ) {
149
149
fileset(dir :" ${ basedir} /grails-app/conf" ) {
150
150
exclude(name :" *.groovy" )
151
151
exclude(name :" log4j.*" )
@@ -165,7 +165,7 @@ target (war: "The implementation target") {
165
165
166
166
// Copy the project's dependencies (JARs mainly) to the staging area.
167
167
if (includeJars) {
168
- ant. copy(todir :" ${ stagingDir} /WEB-INF/lib" ) {
168
+ ant. copy(todir :" ${ stagingDir} /WEB-INF/lib" , preservelastmodified : true ) {
169
169
if (buildConfig. grails. war. dependencies instanceof Closure ) {
170
170
def deps = buildConfig. grails. war. dependencies
171
171
deps. delegate = ant
@@ -178,7 +178,7 @@ target (war: "The implementation target") {
178
178
}
179
179
}
180
180
181
- ant. copy(file :webXmlFile. absolutePath, tofile :" ${ stagingDir} /WEB-INF/web.xml" , overwrite :true )
181
+ ant. copy(file :webXmlFile. absolutePath, tofile :" ${ stagingDir} /WEB-INF/web.xml" , overwrite :true , preservelastmodified : true )
182
182
183
183
def webXML = new File (" ${ stagingDir} /WEB-INF/web.xml" )
184
184
def xmlInput = new XmlParser (). parse(webXML)
@@ -206,7 +206,7 @@ target (war: "The implementation target") {
206
206
207
207
if (includeJars) {
208
208
if (pluginInfos) {
209
- ant. copy(todir :" ${ stagingDir} /WEB-INF/lib" , flatten :true , failonerror :false ) {
209
+ ant. copy(todir :" ${ stagingDir} /WEB-INF/lib" , flatten :true , failonerror :false , preservelastmodified : true ) {
210
210
for (GrailsPluginInfo info in pluginInfos) {
211
211
fileset(dir : info. pluginDir. file. path) {
212
212
include(name :" lib/*.jar" )
@@ -419,7 +419,7 @@ private def warPluginForPluginInfo(GrailsPluginInfo info) {
419
419
// copy views and i18n to /WEB-INF/plugins/...
420
420
def targetPluginDir = " ${ stagingDir} /WEB-INF/plugins/${ info.name} -${ info.version} "
421
421
mkdir(dir : targetPluginDir)
422
- copy(todir : targetPluginDir, failonerror : true ) {
422
+ copy(todir : targetPluginDir, failonerror : true , preservelastmodified : true ) {
423
423
fileset(dir : pluginBase. absolutePath) {
424
424
include(name : " plugin.xml" )
425
425
include(name : " grails-app/views/**" )
@@ -438,7 +438,7 @@ private def warPluginForPluginInfo(GrailsPluginInfo info) {
438
438
// copy spring configs to /WEB-INF/spring/...
439
439
def springDir = new File (" ${ pluginBase.absolutePath} /grails-app/conf/spring" )
440
440
if (springDir. exists()) {
441
- ant. copy(todir : " ${ stagingDir} /WEB-INF/spring" , failonerror : false ) {
441
+ ant. copy(todir : " ${ stagingDir} /WEB-INF/spring" , failonerror : false , preservelastmodified : true ) {
442
442
fileset(dir : springDir, includes : " **/*.xml" )
443
443
}
444
444
}
@@ -449,7 +449,7 @@ private def warPluginForPluginInfo(GrailsPluginInfo info) {
449
449
def hibDir = new File (" ${ pluginBase.absolutePath} /grails-app/conf/hibernate" )
450
450
def javaDir = new File (" ${ pluginBase.absolutePath} /src/java" )
451
451
if (confDir. exists() || hibDir. exists() || javaDir. exists()) {
452
- ant. copy(todir : targetClassesDir, failonerror : false ) {
452
+ ant. copy(todir : targetClassesDir, failonerror : false , preservelastmodified : true ) {
453
453
if (confDir. exists()) {
454
454
fileset(dir : confDir) {
455
455
exclude(name : " *.groovy" )
0 commit comments