Skip to content

Commit

Permalink
Align API
Browse files Browse the repository at this point in the history
  • Loading branch information
cstamas committed Mar 29, 2024
1 parent 819f554 commit 889e011
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ boolean copyTransitive(

boolean copyAllRecorded(ArtifactSink sink, boolean stopRecording, Output output) throws Exception;

boolean deploy(String remoteRepositorySpec, Supplier<Collection<Artifact>> artifactSupplier, Output output)
boolean deploy(RemoteRepository remoteRepository, Supplier<Collection<Artifact>> artifactSupplier, Output output)
throws Exception;

boolean deployAllRecorded(String remoteRepositorySpec, boolean stopRecording, Output output) throws Exception;
boolean deployAllRecorded(RemoteRepository remoteRepository, boolean stopRecording, Output output) throws Exception;

boolean install(Supplier<Collection<Artifact>> artifactSupplier, Output output) throws Exception;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ public boolean copyAllRecorded(ArtifactSink sink, boolean stopRecording, Output
}

@Override
public boolean deploy(String remoteRepositorySpec, Supplier<Collection<Artifact>> artifactSupplier, Output output)
public boolean deploy(
RemoteRepository remoteRepository, Supplier<Collection<Artifact>> artifactSupplier, Output output)
throws Exception {
Collection<Artifact> artifacts = artifactSupplier.get();
RemoteRepository remoteRepository = toolboxResolver.parseRemoteRepository(remoteRepositorySpec);
DeployRequest deployRequest = new DeployRequest();
deployRequest.setRepository(remoteRepository);
artifacts.forEach(deployRequest::addArtifact);
Expand All @@ -422,10 +422,10 @@ public boolean deploy(String remoteRepositorySpec, Supplier<Collection<Artifact>
}

@Override
public boolean deployAllRecorded(String remoteRepositorySpec, boolean stopRecording, Output output)
public boolean deployAllRecorded(RemoteRepository remoteRepository, boolean stopRecording, Output output)
throws Exception {
artifactRecorder.setActive(!stopRecording);
return deploy(remoteRepositorySpec, () -> new HashSet<>(artifactRecorder.getAllArtifacts()), output);
return deploy(remoteRepository, () -> new HashSet<>(artifactRecorder.getAllArtifacts()), output);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ protected boolean doExecute(Output output, ToolboxCommando toolboxCommando) thro
if (javadoc != null) {
projectArtifacts.addJavadoc(javadoc.toPath());
}
return toolboxCommando.deploy(remoteRepositorySpec, projectArtifacts, output);
return toolboxCommando.deploy(
toolboxCommando.parseRemoteRepository(remoteRepositorySpec), projectArtifacts, output);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public final class GavDeployRecordedMojo extends GavMojoSupport {

@Override
protected boolean doExecute(Output output, ToolboxCommando toolboxCommando) throws Exception {
return toolboxCommando.deployAllRecorded(remoteRepositorySpec, true, output);
return toolboxCommando.deployAllRecorded(
toolboxCommando.parseRemoteRepository(remoteRepositorySpec), true, output);
}
}

0 comments on commit 889e011

Please sign in to comment.