diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/AbstractSession.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/AbstractSession.java index 3b9149289a44..464941d23cfc 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/AbstractSession.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/AbstractSession.java @@ -214,7 +214,7 @@ public LocalRepository getLocalRepository() { public Session withLocalRepository(@Nonnull LocalRepository localRepository) { nonNull(localRepository, "localRepository"); if (session.getLocalRepository() != null - && Objects.equals(session.getLocalRepository().getBasedir().toPath(), localRepository.getPath())) { + && Objects.equals(session.getLocalRepository().getBasePath(), localRepository.getPath())) { return this; } org.eclipse.aether.repository.LocalRepository repository = toRepository(localRepository); @@ -293,13 +293,10 @@ public List toArtifacts(Collection getPath(@Nonnull Artifact artifact) { } Path path = paths.get(id); if (path == null && artifact instanceof DefaultArtifact) { - File file = ((DefaultArtifact) artifact).getArtifact().getFile(); - if (file != null) { - path = file.toPath(); - } + path = ((DefaultArtifact) artifact).getArtifact().getPath(); } return Optional.ofNullable(path); } diff --git a/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java b/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java index 1cc4eff2d760..e9ab683c3178 100644 --- a/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java +++ b/maven-core/src/test/java/org/apache/maven/repository/TestRepositoryConnector.java @@ -75,7 +75,7 @@ public void get( for (ArtifactDownload download : artifactDownloads) { File remoteFile = new File(basedir, path(download.getArtifact())); try { - Path dest = download.getFile().toPath(); + Path dest = download.getPath(); Files.createDirectories(dest.getParent()); Files.copy(remoteFile.toPath(), dest); } catch (IOException e) { @@ -91,7 +91,7 @@ public void get( for (final MetadataDownload download : metadataDownloads) { File remoteFile = new File(basedir, path(download.getMetadata())); try { - Path dest = download.getFile().toPath(); + Path dest = download.getPath(); Files.createDirectories(dest.getParent()); Files.copy(remoteFile.toPath(), dest); } catch (IOException e) { diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java index bc84b81c2144..aa28e758b7ec 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java @@ -1190,7 +1190,7 @@ private org.apache.maven.api.model.Model doReadFileModel( } if (modelSource instanceof FileModelSource) { - model = model.withPomFile(((FileModelSource) modelSource).getFile().toPath()); + model = model.withPomFile(((FileModelSource) modelSource).getPath()); } Model retModel = new Model(model); diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java index e0f8b8b92c4d..02b60612c82e 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/RelocatedArtifact.java @@ -116,17 +116,6 @@ public Artifact setVersion(String version) { return new RelocatedArtifact(artifact, groupId, artifactId, classifier, extension, version, message); } - @Deprecated - @Override - public Artifact setFile(File file) { - File current = getFile(); - if (Objects.equals(current, file)) { - return this; - } - return new RelocatedArtifact( - artifact.setFile(file), groupId, artifactId, classifier, extension, version, message); - } - @Override public Artifact setPath(Path path) { Path current = getPath();