Package org.codehaus.plexus.configuration

Examples of org.codehaus.plexus.configuration.PlexusConfiguration.addChild()


            for (Entry<String,String> e : props.entrySet()) {
                if(manifestEntries.getChild(e.getKey(),false)!=null)
                    continue; // if the configuration is already given, use that.
                XmlPlexusConfiguration configuration = new XmlPlexusConfiguration(e.getKey());
                configuration.setValue(e.getValue());
                manifestEntries.addChild(configuration);
            }
        }

        return super.preExecute(build, pom, mojo, listener);
    }
View Full Code Here


        componentDescriptor.setImplementation( implementation );

        PlexusConfiguration configuration = new XmlPlexusConfiguration( "configuration" );

        configuration.addChild( c );

        try
        {
            configurator.configureComponent( this, configuration, plexusRealm );
        }
View Full Code Here

        componentDescriptor.setImplementation( implementation );

        PlexusConfiguration configuration = new XmlPlexusConfiguration( "configuration" );

        configuration.addChild( c );

        try
        {
            configurator.configureComponent( this, configuration, plexusRealm );
        }
View Full Code Here

  }
 
  @Test
  public void canConfigureMojo_usingConfig() throws Exception {
    PlexusConfiguration config = new DefaultPlexusConfiguration("configuration");
    config.addChild("greeting", "configWorld");
   
    GreetMojo greetMojo = (GreetMojo) rule.configureMojo(new GreetMojo(), config);
    Assert.assertEquals("configWorld", greetMojo.getGreeting());
  }
 
View Full Code Here

  @Test
  public void canInjectProject_usingConfig() throws Exception {
    PlexusConfiguration config = new DefaultPlexusConfiguration("configuration");
    XmlPlexusConfiguration xmlConfig = new XmlPlexusConfiguration("project");
    xmlConfig.setAttribute("implementation", "ch.inftec.ju.maven.test.GreetMojoTest_MavenProject");
    config.addChild(xmlConfig);
   
    GreetMojo greetMojo = (GreetMojo) rule.configureMojo(new GreetMojo(), config);
   
    Assert.assertNotNull(greetMojo.getProject());
    Assert.assertEquals(GreetMojoTest_MavenProject.class, greetMojo.getProject().getClass());
View Full Code Here

    // lookupMojo needs the actual version as it seems to use the Maven local repo to lookup stuff...
    String version = new XPathGetter(XmlUtils.loadXml(JuUrl.toUrl(JuUrl.existingFile("pom.xml")))).getSingle("project/parent/version");
   
    // Default value setting will not work when using explicit (or no) PlexusConfiguration
    PlexusConfiguration config = new DefaultPlexusConfiguration("configuration");
    config.addChild("greeting", "NoPomWorld");
    GreetMojo greetMojo = (GreetMojo) this.lookupMojo("ch.inftec.ju", "ju-maven-plugin", version, "greet", config);
    Assert.assertEquals("NoPomWorld", greetMojo.getGreeting());
    greetMojo.execute();
  }
}
View Full Code Here

  @Test
  public void canExecute_debugPropertiesMojo() throws Exception {
    PlexusConfiguration config = new DefaultPlexusConfiguration("configuration");
    XmlPlexusConfiguration xmlConfig = new XmlPlexusConfiguration("project");
    xmlConfig.setAttribute("implementation", "ch.inftec.ju.maven.test.GreetMojoTest_MavenProject");
    config.addChild(xmlConfig);
//    config.addChild("greeting", "configWorld");
   
    DebugMojo m = (DebugMojo) rule.configureMojo(new DebugMojo(), config);
   
    m.execute();
View Full Code Here

        componentDescriptor.setRealmId( container.getContainerRealm().getId() );

        PlexusConfiguration configuration = new XmlPlexusConfiguration( "containerConfiguration" );

        configuration.addChild( c );

        try
        {
            configurator.configureComponent( container, configuration, container.getContainerRealm() );
        }
View Full Code Here

        componentDescriptor.setImplementation( implementation );

        PlexusConfiguration configuration = new XmlPlexusConfiguration( "containerConfiguration" );

        configuration.addChild( c );

        try
        {
            configurator.configureComponent( container, configuration, container.getContainerRealm() );
        }
View Full Code Here

        } else {
          listener.getLogger().println("[JENKINS] Configuring cobertura-maven-plugin to enable xml reports");
          if (!maven3orLater) {
              XmlPlexusConfiguration fmt = new XmlPlexusConfiguration("format");
              fmt.setValue("xml"); // need this
              c.addChild(fmt);
          } else {
                       Xpp3Dom fmt = new Xpp3Dom("format");
                       fmt.setValue("xml");
                       Xpp3Dom formats = mojo.mojoExecution.getConfiguration().getChild( "formats" );
                       if (formats == null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.