Index: src/java/org/codehaus/groovy/grails/plugins/DefaultGrailsPlugin.java =================================================================== --- src/java/org/codehaus/groovy/grails/plugins/DefaultGrailsPlugin.java (revision 7f05581de87aad054f7e661d0c754e16780c1eb2) +++ src/java/org/codehaus/groovy/grails/plugins/DefaultGrailsPlugin.java Wed Dec 23 09:04:23 CST 2009 @@ -508,12 +508,27 @@ modifiedTimes = new long[watchedResources.length]; for (int i = 0; i < watchedResources.length; i++) { Resource r = watchedResources[i]; - URLConnection c = r.getURL().openConnection(); + URLConnection c = null; + try { + c = r.getURL().openConnection(); - c.setDoInput(false); - c.setDoOutput(false); - modifiedTimes[i] = c.getLastModified(); + c.setDoInput(false); + c.setDoOutput(false); + modifiedTimes[i] = c.getLastModified(); + } finally { + if (c != null) { + try { + InputStream is = c.getInputStream(); + if (is != null) { + is.close(); - } - } + } + } + catch (IOException e) { + // ignore + } + } + } + } + } public void doWithApplicationContext(ApplicationContext applicationContext) { try {