Skip to content

Commit

Permalink
Expose repository environment to MavenProtocResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
ascopes committed Oct 23, 2023
1 parent fff144b commit 49aafe6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
private ProtocResolver buildProtocResolver() {
switch (resolverKind) {
case MAVEN:
return new MavenProtocResolver(version);
return new MavenProtocResolver(version, repositorySystem, session);
case PATH:
return new PathProtocResolver(executableName);
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package io.github.ascopes.protobufmavenplugin.resolver;

import java.nio.file.Path;
import org.apache.maven.execution.MavenSession;
import org.eclipse.aether.RepositorySystem;

/**
* Resolver for {@code protoc} which looks up the provided version in the Maven remote repositories
Expand All @@ -27,9 +29,13 @@
public final class MavenProtocResolver implements ProtocResolver {

private final String version;
private final RepositorySystem repositorySystem;
private final MavenSession session;

public MavenProtocResolver(String version) {
public MavenProtocResolver(String version, RepositorySystem repositorySystem, MavenSession session) {
this.version = version;
this.repositorySystem = repositorySystem;
this.session = session;
}

@Override
Expand Down

0 comments on commit 49aafe6

Please sign in to comment.