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

com.lesfurets.maven.partial.core.Modules Maven / Gradle / Ivy

Go to download

A maven plugin for partially building multi-module projects based on changes in the Git repository.

The newest version!
package com.lesfurets.maven.partial.core;

import java.io.IOException;
import java.nio.file.Path;
import java.util.Map;
import java.util.stream.Collectors;

import org.apache.maven.execution.MavenSession;
import org.apache.maven.project.MavenProject;

import com.google.inject.Inject;
import com.google.inject.Singleton;

@Singleton
public class Modules {

    @Inject
    MavenSession session;

    public Map createPathMap() {
        return session.getProjects().stream()
                        .collect(Collectors.toMap(Modules::getPath, project -> project));
    }

    public static Path getPath(MavenProject project) {
        try {
            return project.getBasedir().toPath().normalize().toAbsolutePath().toRealPath();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy