com.lesfurets.maven.partial.core.Modules Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of partial-build-plugin Show documentation
Show all versions of partial-build-plugin Show documentation
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);
}
}
}