All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.bootstrap.resolver.maven.MavenLocalPomResolver Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package io.quarkus.bootstrap.resolver.maven;

import java.io.File;
import java.util.Objects;

public class MavenLocalPomResolver implements LocalPomResolver {

    private static String getRelativePomPath(String groupId, String artifactId, String version) {
        return groupId.replace('.', File.separatorChar) + File.separator +
                artifactId + File.separator +
                version + File.separator +
                artifactId + '-' +
                version + ".pom";
    }

    private final File repoDir;

    public MavenLocalPomResolver(File repoDir) {
        this.repoDir = Objects.requireNonNull(repoDir);
    }

    @Override
    public File resolvePom(String groupId, String artifactId, String version) {
        var pom = new File(repoDir, getRelativePomPath(groupId, artifactId, version));
        return pom.exists() ? pom : null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy