Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump commons-io to 2.11.0 #311

Merged
merged 1 commit into from Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 ) );
}

}