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

org.togglz.test.MavenDependenciesBuilder Maven / Gradle / Ivy

There is a newer version: 4.4.0
Show newest version
package org.togglz.test;

import java.io.File;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;

import org.jboss.shrinkwrap.resolver.api.maven.Maven;

public class MavenDependenciesBuilder {

    private final List artifacts = new ArrayList<>();
    private final String filesystemPomPath = Paths.get("").toAbsolutePath().resolve("pom.xml").toString();

    public MavenDependenciesBuilder artifact(String artifact) {
        artifacts.add(artifact);
        return this;
    }

    public File[] asFiles() {
        return Maven.resolver().loadPomFromFile(filesystemPomPath).resolve(artifacts).withTransitivity().asFile();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy