@Override
  protected void before()
      throws ComponentLookupException, URISyntaxException, MalformedURLException {
    MojoRule testHarness = new MojoRule();
    ArtifactRepositoryFactory artifactRepositoryFactory =
        testHarness.lookup(ArtifactRepositoryFactory.class);
    artifactResolver = testHarness.lookup(ArtifactResolver.class);
    jarHandler = testHarness.lookup(ArtifactHandlerManager.class).getArtifactHandler("jar");
    testLocalRepo =
        artifactRepositoryFactory.createArtifactRepository(
            "test",
            Resources.getResource(TEST_M2).toURI().toURL().toString(),
            new DefaultRepositoryLayout(),
            null,
            null);
  }
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