private void copyProject() throws IOException {
    projectRoot =
        ResourceExtractor.extractResourcePath(
                TestProject.class, PROJECTS_PATH_IN_RESOURCES + projectDir, newFolder(), true)
            .toPath();

    // Puts the correct plugin version into the test project pom.xml.
    Path gradleProperties = Paths.get("gradle.properties");
    Properties properties = new Properties();
    properties.load(Files.newInputStream(gradleProperties));
    String pluginVersion = properties.getProperty("version");

    new DirectoryWalker(projectRoot)
        .filter(TestProject::isPomXml)
        .walk(
            pomXml ->
                Files.write(
                    pomXml,
                    new String(Files.readAllBytes(pomXml), StandardCharsets.UTF_8)
                        .replace("@@PluginVersion@@", pluginVersion)
                        .getBytes(StandardCharsets.UTF_8)));
  }
Gets the project root resolved as a real path.
jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/TestProject.java