Skip to content

Commit

Permalink
Merge pull request apache#193 from famod/fix-win-test
Browse files Browse the repository at this point in the history
Fix FlattenMojoTest on Windows
  • Loading branch information
lasselindqvist committed Jan 16, 2021
2 parents 80dadfd + 75e9eaf commit 22271ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/test/java/org/codehaus/mojo/flatten/FlattenMojoTest.java
Expand Up @@ -68,9 +68,9 @@ private static String profileActivationFile( String pom ) throws Exception {
}

private static Model readPom(String pomFilePath) throws IOException, XmlPullParserException {
MavenXpp3Reader reader = new MavenXpp3Reader();

return reader.read( new FileInputStream( new File( pomFilePath ) ) );
try ( FileInputStream input = new FileInputStream( new File( pomFilePath ) ) ) {
return new MavenXpp3Reader().read( input );
}
}

/**
Expand All @@ -83,7 +83,7 @@ public void removeFlattenedPom() throws IOException {
File flattenedPom = new File( FLATTENED_POM );
if ( flattenedPom.exists() ) {
if ( !flattenedPom.delete() ) {
throw new IOException( "Can't delete %s" + flattenedPom );
throw new IOException( "Can't delete" + flattenedPom );
}
}
}
Expand Down

0 comments on commit 22271ee

Please sign in to comment.