Artifact findArtifact(String group, String artifact, String version) {
    ArtifactResolutionRequest artifactResolutionRequest = new ArtifactResolutionRequest();
    artifactResolutionRequest.setLocalRepository(testLocalRepo);
    Artifact artifactToFind =
        new DefaultArtifact(group, artifact, version, null, "jar", null, jarHandler);

    artifactResolutionRequest.setArtifact(artifactToFind);

    ArtifactResolutionResult ars = artifactResolver.resolve(artifactResolutionRequest);

    Assert.assertEquals(1, ars.getArtifacts().size());
    return ars.getArtifacts().iterator().next();
  }
A test helper to resolve artifacts from a local repository in test/resources.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/TestRepository.java