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

Use commons-io over legacy plexus and use newer maven plugin testing harness #685

Merged
merged 2 commits into from
Dec 13, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package com.mycila.maven.plugin.license.util;

import org.codehaus.plexus.util.IOUtil;
import org.apache.commons.io.IOUtils;
import org.codehaus.plexus.util.InterpolationFilterReader;

import java.io.BufferedReader;
Expand Down Expand Up @@ -59,21 +59,21 @@ public static void write(File file, String content, Charset encoding) throws IOE

public static String read(URL location, Charset encoding, Map<String, Object> properties) throws IOException, URISyntaxException {
try (Reader reader = new InterpolationFilterReader(Files.newBufferedReader(Paths.get(location.toURI()), encoding), properties)) {
return IOUtil.toString(reader);
return IOUtils.toString(reader);
}
}

public static String read(URL location, Charset encoding) throws IOException, URISyntaxException {
try (Reader reader = Files.newBufferedReader(Paths.get(location.toURI()), encoding)) {
return IOUtil.toString(reader);
return IOUtils.toString(reader);
}
}

public static String[] read(final URL[] locations, final Charset encoding) throws IOException, URISyntaxException {
final String[] results = new String[locations.length];
for (int i = 0; i < locations.length; i++) {
try (Reader reader = Files.newBufferedReader(Paths.get(locations[i].toURI()), encoding)) {
results[i] = IOUtil.toString(reader);
results[i] = IOUtils.toString(reader);
}
}
return results;
Expand Down
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,7 @@
<dependency>
<groupId>org.apache.maven.plugin-testing</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>3.3.0</version>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
<version>4.0.0-alpha-2</version>
</dependency>

<dependency>
Expand Down