use of org.codehaus.plexus.configuration.PlexusConfiguration in project intellij-plugins by JetBrains.
the class AdditionalSourceRootUtil method collectGeneratedSource.
private static void collectGeneratedSource(PlexusConfiguration parentConfiguration, String parameterName, MavenProject project, PluginParameterExpressionEvaluator expressionEvaluator, Logger logger) {
final PlexusConfiguration configuration = parentConfiguration.getChild(parameterName);
if (configuration == null) {
return;
}
String filepath = configuration.getValue();
if (filepath == null) {
final String defaultValue = configuration.getAttribute("default-value");
if (defaultValue == null) {
return;
}
filepath = (String) evaluate(expressionEvaluator, defaultValue, logger);
}
if (filepath != null) {
addFile(filepath, project, expressionEvaluator);
}
}
use of org.codehaus.plexus.configuration.PlexusConfiguration in project intellij-plugins by JetBrains.
the class AdditionalSourceRootUtil method addByGeneratorMojo.
public static void addByGeneratorMojo(MojoExecution mojoExecution, MavenSession session, MavenProject project, Logger logger) {
final PluginParameterExpressionEvaluator expressionEvaluator = new PluginParameterExpressionEvaluator(session, mojoExecution);
final PlexusConfiguration configuration = new XmlPlexusConfiguration(mojoExecution.getConfiguration());
for (String parameterName : new String[] { "baseOutputDirectory", "outputDirectory" }) {
collectGeneratedSource(configuration, parameterName, project, expressionEvaluator, logger);
}
}
use of org.codehaus.plexus.configuration.PlexusConfiguration in project randomizedtesting by randomizedtesting.
the class JUnit4Mojo method populateJUnitElement.
/**
* Populate junit4 task with attributes and values.
*/
private void populateJUnitElement(Element junit4) {
// Attributes.
if (dir != null)
junit4.addAttribute("dir", dir.getAbsolutePath());
if (tempDir != null)
junit4.addAttribute("tempDir", tempDir.getAbsolutePath());
if (parallelism != null)
junit4.addAttribute("parallelism", parallelism);
if (failureProperty != null)
junit4.addAttribute("failureProperty", failureProperty);
if (seed != null)
junit4.addAttribute("seed", seed);
if (jvm != null)
junit4.addAttribute("jvm", jvm);
if (maxMemory != null)
junit4.addAttribute("maxMemory", maxMemory);
if (jvmOutputAction != null)
junit4.addAttribute("jvmOutputAction", jvmOutputAction);
if (heartbeat != 0)
junit4.addAttribute("heartbeat", Long.toString(heartbeat));
if (prefix != null)
junit4.addAttribute("prefix", prefix);
if (debugStream != null)
junit4.addAttribute("debugStream", debugStream.toString());
if (newEnvironment != null)
junit4.addAttribute("newEnvironment", newEnvironment.toString());
if (ifNoTests != null)
junit4.addAttribute("ifNoTests", ifNoTests);
if (statsPropertyPrefix != null)
junit4.addAttribute("statsPropertyPrefix", statsPropertyPrefix);
if (onNonEmptyWorkDirectory != null)
junit4.addAttribute("onNonEmptyWorkDirectory", onNonEmptyWorkDirectory);
junit4.addAttribute("shuffleOnSlave", Boolean.toString(shuffleOnSlave));
junit4.addAttribute("printSummary", Boolean.toString(printSummary));
junit4.addAttribute("isolateWorkingDirectories", Boolean.toString(isolateWorkingDirectories));
junit4.addAttribute("haltOnFailure", Boolean.toString(haltOnFailure));
junit4.addAttribute("leaveTemporary", Boolean.toString(leaveTemporary));
junit4.addAttribute("dynamicAssignmentRatio", Float.toString(dynamicAssignmentRatio));
junit4.addAttribute("sysouts", Boolean.toString(sysouts));
junit4.addAttribute("uniqueSuiteNames", Boolean.toString(uniqueSuiteNames));
// JVM args.
for (String jvmArg : firstNonNull(jvmArgs, EMPTY_STRING_ARRAY)) {
junit4.addElement("jvmarg").addAttribute("value", jvmArg);
}
if (argLine != null) {
junit4.addElement("jvmarg").addAttribute("line", argLine);
}
// System properties
for (Map.Entry<String, String> e : firstNonNull(systemProperties, EMPTY_STRING_STRING_MAP).entrySet()) {
Element sysproperty = junit4.addElement("sysproperty");
sysproperty.addAttribute("key", Strings.nullToEmpty(e.getKey()));
sysproperty.addAttribute("value", Strings.nullToEmpty(e.getValue()));
}
// Environment variables.
for (Map.Entry<String, String> e : firstNonNull(environmentVariables, EMPTY_STRING_STRING_MAP).entrySet()) {
Element sysproperty = junit4.addElement("env");
sysproperty.addAttribute("key", Strings.nullToEmpty(e.getKey()));
sysproperty.addAttribute("value", Strings.nullToEmpty(e.getValue()));
}
// Tests input.
setupTestInput(junit4);
// Tests classpath
setupTestClasspath(junit4);
// Copy over listeners configuration.
if (listeners != null) {
appendRawXml(listeners, junit4);
} else {
// Add a console listener and a surefire-like XML listener.
Element listenersElement = junit4.addElement("listeners");
Element surefireReport = listenersElement.addElement("report-ant-xml");
surefireReport.addAttribute("dir", surefireReportsDirectory.getAbsolutePath());
surefireReport.addAttribute("mavenExtensions", "true");
Element consoleReport = listenersElement.addElement("report-text");
consoleReport.addAttribute("showThrowable", "true");
consoleReport.addAttribute("showStackTraces", "true");
consoleReport.addAttribute("showOutput", "never");
consoleReport.addAttribute("showStatusOk", "false");
consoleReport.addAttribute("showStatusError", "true");
consoleReport.addAttribute("showStatusFailure", "true");
consoleReport.addAttribute("showStatusIgnored", "false");
consoleReport.addAttribute("showSuiteSummary", "true");
}
// Copy over assertions
appendRawXml(assertions, junit4);
// Copy over balancers
appendRawXml(balancers, junit4);
// Copy over verbatim section.
if (verbatim != null) {
for (PlexusConfiguration c : verbatim.getChildren()) {
appendRawXml(c, junit4);
}
}
}
use of org.codehaus.plexus.configuration.PlexusConfiguration in project liquibase by liquibase.
the class LiquibaseDropAllMojoTest method createDropAllMojo.
/*-------------------------------------------------------------------------*\
* PRIVATE METHODS
\*-------------------------------------------------------------------------*/
private LiquibaseDropAll createDropAllMojo() throws Exception {
LiquibaseDropAll mojo = new LiquibaseDropAll();
PlexusConfiguration config = loadConfiguration(CONFIG_FILE);
configureMojo(mojo, config);
return mojo;
}
use of org.codehaus.plexus.configuration.PlexusConfiguration in project liquibase by liquibase.
the class LiquibaseRollbackMojoTest method createUpdateMojo.
/*-------------------------------------------------------------------------*\
* PRIVATE METHODS
\*-------------------------------------------------------------------------*/
private LiquibaseRollback createUpdateMojo(String configFileName) throws Exception {
LiquibaseRollback mojo = new LiquibaseRollback();
PlexusConfiguration config = loadConfiguration(configFileName);
configureMojo(mojo, config);
return mojo;
}
Aggregations