Skip to content

Commit

Permalink
Remove a few other references
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed May 2, 2024
1 parent a014700 commit 4a6ab18
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ private void installIntoProjectLocalRepository(Artifact artifact) {
LOGGER.info("Copying {} to project local repository", artifact);
Files.createDirectories(target.getParent());
Files.copy(
artifact.getFile().toPath(),
artifact.getPath(),
target,
StandardCopyOption.REPLACE_EXISTING,
StandardCopyOption.COPY_ATTRIBUTES);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ public Optional<Path> 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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 4a6ab18

Please sign in to comment.