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

com.robertboothby.utilities.maven.MavenUtilities Maven / Gradle / Ivy

Go to download

This project contains an Abstract Mojo that provides the foundation for Maven plugins that wish to produce files using Freemarker templates.

There is a newer version: 0.2.0
Show newest version
package com.robertboothby.utilities.maven;

import org.apache.maven.project.MavenProject;

import java.io.File;

public class MavenUtilities {

    /**
     * Utility method that takes a directory and if it is not absolute resolves it against the Maven project base directory.
     * @param directory The directory to resolve.
     * @param project The Maven project whose base directory to use.
     * @return the resolved directory.
     * @see Resolving Relative Paths
     */
    public static File getAbsoluteBuildDirectory(File directory, MavenProject project) {
        if(!directory.isAbsolute()){
            directory = new File(project.getBasedir(), directory.getPath());
        }
        return directory;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy