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

Remove commons-io:commons-io dependency #1578

Merged
merged 1 commit into from
Jun 11, 2024
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
5 changes: 0 additions & 5 deletions maven-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@ under the License.
<version>${mockitoVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.Properties;
import java.util.concurrent.atomic.AtomicInteger;

import org.apache.commons.io.FileUtils;
import org.apache.maven.AbstractCoreMavenComponentTestCase;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Dependency;
Expand All @@ -38,6 +37,7 @@
import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.model.building.ModelProblem;
import org.apache.maven.model.building.ModelSource;
import org.codehaus.plexus.util.FileUtils;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

Expand Down Expand Up @@ -169,7 +169,8 @@ void testReadModifiedPoms(@TempDir Path tempDir) throws Exception {
// TODO a similar test should be created to test the dependency management (basically all usages
// of DefaultModelBuilder.getCache() are affected by MNG-6530

FileUtils.copyDirectory(new File("src/test/resources/projects/grandchild-check"), tempDir.toFile());
FileUtils.copyDirectoryStructure(new File("src/test/resources/projects/grandchild-check"), tempDir.toFile());

MavenSession mavenSession = createMavenSession(null);
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
configuration.setRepositorySession(mavenSession.getRepositorySession());
Expand Down
5 changes: 0 additions & 5 deletions maven-embedder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ under the License.
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@
*/
package org.apache.maven.cli;

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;

import org.apache.commons.cli.Option;
import org.apache.commons.io.FileUtils;
import org.junit.jupiter.api.Test;

import static java.util.Objects.nonNull;
Expand Down Expand Up @@ -111,7 +113,7 @@ String getOptionsAsHtml() {

@Test
void testOptionsAsHtml() throws IOException {
File options = new File("target/test-classes/options.html");
FileUtils.write(options, getOptionsAsHtml(), "UTF-8");
Path options = Paths.get("target/test-classes/options.html");
Files.writeString(options, getOptionsAsHtml(), StandardCharsets.UTF_8);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
package org.apache.maven.cli.event;

import java.io.File;
import java.util.List;

import com.google.common.collect.ImmutableList;
import org.apache.commons.io.FilenameUtils;
import org.apache.maven.execution.ExecutionEvent;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.jline.JLineMessageBuilderFactory;
Expand Down Expand Up @@ -203,8 +202,8 @@ void testMultiModuleProjectProgress() {
MavenProject project3 = generateMavenProject("Apache Maven Embedder 3");

MavenSession session = mock(MavenSession.class);
when(session.getProjects()).thenReturn(ImmutableList.of(project1, project2, project3));
when(session.getAllProjects()).thenReturn(ImmutableList.of(project1, project2, project3));
when(session.getProjects()).thenReturn(List.of(project1, project2, project3));
when(session.getAllProjects()).thenReturn(List.of(project1, project2, project3));

ExecutionEvent sessionStartedEvent = mock(ExecutionEvent.class);
when(sessionStartedEvent.getSession()).thenReturn(session);
Expand Down Expand Up @@ -236,8 +235,8 @@ void testMultiModuleProjectResumeFromProgress() {
MavenProject project3 = generateMavenProject("Apache Maven Embedder 3");

MavenSession session = mock(MavenSession.class);
when(session.getProjects()).thenReturn(ImmutableList.of(project2, project3));
when(session.getAllProjects()).thenReturn(ImmutableList.of(project1, project2, project3));
when(session.getProjects()).thenReturn(List.of(project2, project3));
when(session.getAllProjects()).thenReturn(List.of(project1, project2, project3));

ExecutionEvent sessionStartedEvent = mock(ExecutionEvent.class);
when(sessionStartedEvent.getSession()).thenReturn(session);
Expand Down Expand Up @@ -267,6 +266,6 @@ private static MavenProject generateMavenProject(String projectName) {
}

private static String adaptDirSeparator(String path) {
return FilenameUtils.separatorsToSystem(path);
return path.replace('/', File.separatorChar).replace('\\', File.separatorChar);
}
}
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ under the License.
<cipherVersion>2.0</cipherVersion>
<classWorldsVersion>2.8.0</classWorldsVersion>
<commonsCliVersion>1.8.0</commonsCliVersion>
<commonsIoVersion>2.11.0</commonsIoVersion>
<guiceVersion>6.0.0</guiceVersion>
<guavaVersion>33.2.0-jre</guavaVersion>
<guavafailureaccessVersion>1.0.1</guavafailureaccessVersion>
Expand Down Expand Up @@ -552,11 +551,6 @@ under the License.
<artifactId>commons-cli</artifactId>
<version>${commonsCliVersion}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commonsIoVersion}</version>
</dependency>
<dependency>
<groupId>commons-jxpath</groupId>
<artifactId>commons-jxpath</artifactId>
Expand Down