com.buschmais.jqassistant.scm.maven.EffectiveConfigurationMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jqassistant-maven-plugin Show documentation
Show all versions of jqassistant-maven-plugin Show documentation
jQAssistant plugin for Apache Maven to integrate jQAssistant
into a Maven based project.
package com.buschmais.jqassistant.scm.maven;
import com.buschmais.jqassistant.core.runtime.api.configuration.ConfigurationSerializer;
import com.buschmais.jqassistant.core.runtime.impl.configuration.ConfigurationSerializerImpl;
import com.buschmais.jqassistant.scm.maven.configuration.MavenConfiguration;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Lists all effective rules.
*/
@Mojo(name = "effective-configuration", defaultPhase = LifecyclePhase.VALIDATE, threadSafe = true)
public class EffectiveConfigurationMojo extends AbstractRuleMojo {
private static final Logger LOGGER = LoggerFactory.getLogger(EffectiveConfigurationMojo.class);
private final ConfigurationSerializer configurationSerializer = new ConfigurationSerializerImpl<>();
@Override
public void aggregate(MojoExecutionContext mojoExecutionContext) throws MojoExecutionException, MojoFailureException {
getLog().info("Effective configuration for '" + mojoExecutionContext.getRootModule()
.getName() + "'\n" + configurationSerializer.toYaml(mojoExecutionContext.getConfiguration()));
}
}