Skip to content

Commit

Permalink
Bump commons-io to 2.11.0
Browse files Browse the repository at this point in the history
fix #268
  • Loading branch information
slawekjaranowski committed Aug 15, 2022
1 parent 592c8cd commit 5bbe99e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
11 changes: 11 additions & 0 deletions pom.xml
Expand Up @@ -127,6 +127,17 @@
<project.build.outputTimestamp>2021-03-01T20:31:11Z</project.build.outputTimestamp>
</properties>

<!-- override versions of some transitive dependencies -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- plugin tools -->
<dependency>
Expand Down
15 changes: 4 additions & 11 deletions src/test/java/org/codehaus/mojo/flatten/KeepCommentsInPomTest.java
Expand Up @@ -20,11 +20,11 @@
*/

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;

import org.apache.commons.io.IOUtils;
import org.apache.maven.plugin.testing.MojoRule;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.configuration.DefaultPlexusConfiguration;
Expand Down Expand Up @@ -112,14 +112,7 @@ private boolean isJdk8()
*/
private String getContent( String aPomFile ) throws IOException
{
String tempString;
try ( InputStream tempIn = new FileInputStream( aPomFile ) )
{
tempString = IOUtils.toString( tempIn );
}
// remove platform dependent CR/LF
tempString = tempString.replaceAll( "\r\n", "\n" );
return tempString;
return String.join( "\n", Files.readAllLines( Paths.get( aPomFile ), StandardCharsets.UTF_8 ) );
}

}

0 comments on commit 5bbe99e

Please sign in to comment.