Index: src/java/org/apache/maven/MavenUtils.java =================================================================== --- src/java/org/apache/maven/MavenUtils.java (revision 405314) +++ src/java/org/apache/maven/MavenUtils.java (working copy) @@ -549,7 +549,7 @@ * @return The generated maven based on the contents of the standard maven * properties files. */ - public static MavenJellyContext createContext( File descriptorDirectory, + public static MavenJellyContext createContext( File descriptorDirectory, MavenJellyContext parentContext ) { MavenJellyContext context = createContextNoDefaults( descriptorDirectory, parentContext ); @@ -568,7 +568,7 @@ * @return The generated maven based on the contents of the standard maven * properties files. */ - private static MavenJellyContext createContextNoDefaults( File descriptorDirectory, + private static MavenJellyContext createContextNoDefaults( File descriptorDirectory, MavenJellyContext parentContext ) { // System properties @@ -699,11 +699,13 @@ */ private static Properties loadProperties( File file ) { + FileInputStream fis; try { if ( file.exists() ) { - return loadProperties( new FileInputStream (file) ); + fis = new FileInputStream (file); + return loadProperties(fis); } } catch ( Exception e ) @@ -711,6 +713,10 @@ // ignore log.debug("Unexpected error loading properties", e); } + finally { + if (fis != null) + fis.close(); + } return null; }