io.sealights.onpremise.agents.plugin.MavenSessionExtension Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sealights-maven-plugin
Show all versions of sealights-maven-plugin
A maven plugin to run java agents.
The newest version!
package io.sealights.onpremise.agents.plugin;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.maven.project.MavenProject;
import io.sealights.onpremise.agents.plugin.surefire.PluginsHandler;
import lombok.Getter;
import org.slf4j.Logger;
/**
* Encapsulates data of the whole maven session, which is shared by all sub-projects
*
* @author AlaSchneider
*
*/
public enum MavenSessionExtension {
INSTANCE;
@Getter
// Map key is a subproject name
private Map testPluginsHandlers = new ConcurrentHashMap<>();
public PluginsHandler getOrCreateTestPluginsHandler(MavenProject project, Logger logger) {
if (!testPluginsHandlers.containsKey(project.getName())) {
testPluginsHandlers.put(project.getName(), new PluginsHandler(project, logger));
}
// The map is synchronized, since subprojects may be built in parallel.
// The value does not demand synchronization, since a subproject mojos are executed serially.
return testPluginsHandlers.get(project.getName());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy