Search in sources :

Example 1 with AntrunXmlPlexusConfigurationWriter

use of org.apache.maven.plugin.antrun.AntrunXmlPlexusConfigurationWriter in project randomizedtesting by randomizedtesting.

the class JUnit4Mojo method appendRawXml.

/**
   * Append raw XML configuration. 
   */
private void appendRawXml(PlexusConfiguration config, Element elem) {
    try {
        if (config == null) {
            return;
        }
        StringWriter writer = new StringWriter();
        AntrunXmlPlexusConfigurationWriter xmlWriter = new AntrunXmlPlexusConfigurationWriter();
        xmlWriter.write(config, writer);
        Element root = new SAXReader().read(new StringReader(writer.toString())).getRootElement();
        root.detach();
        elem.add(root);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : StringWriter(java.io.StringWriter) AntrunXmlPlexusConfigurationWriter(org.apache.maven.plugin.antrun.AntrunXmlPlexusConfigurationWriter) SAXReader(org.dom4j.io.SAXReader) Element(org.dom4j.Element) StringReader(java.io.StringReader) InvalidVersionSpecificationException(org.apache.maven.artifact.versioning.InvalidVersionSpecificationException) IOException(java.io.IOException) BuildException(org.apache.tools.ant.BuildException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) MojoFailureException(org.apache.maven.plugin.MojoFailureException)

Aggregations

IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 StringWriter (java.io.StringWriter)1 InvalidVersionSpecificationException (org.apache.maven.artifact.versioning.InvalidVersionSpecificationException)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1 AntrunXmlPlexusConfigurationWriter (org.apache.maven.plugin.antrun.AntrunXmlPlexusConfigurationWriter)1 BuildException (org.apache.tools.ant.BuildException)1 Element (org.dom4j.Element)1 SAXReader (org.dom4j.io.SAXReader)1