protected void executeMojo ( String groupId , String artifactId , String version , String goal , String configuration , Dependency ... dependencies ) throws MojoExecutionException , MojoFailureException { final Plugin plugin = new Plugin ( ) ; plugin . setArtifactId ( artifactId ) ; plugin . setGroupId ( groupId ) ; plugin . setVersion ( version ) ; plugin . setDependencies ( Arrays . asList ( dependencies ) ) ; getLog ( ) . debug ( MessageFormat . format ( Messages . AbstractSarlMojo_0 , plugin . getId ( ) ) ) ; final PluginDescriptor pluginDescriptor = this . mavenHelper . loadPlugin ( plugin ) ; if ( pluginDescriptor == null ) { throw new MojoExecutionException ( MessageFormat . format ( Messages . AbstractSarlMojo_1 , plugin . getId ( ) ) ) ; } final MojoDescriptor mojoDescriptor = pluginDescriptor . getMojo ( goal ) ; if ( mojoDescriptor == null ) { throw new MojoExecutionException ( MessageFormat . format ( Messages . AbstractSarlMojo_2 , goal ) ) ; } final Xpp3Dom mojoXml ; try { mojoXml = this . mavenHelper . toXpp3Dom ( mojoDescriptor . getMojoConfiguration ( ) ) ; } catch ( PlexusConfigurationException e1 ) { throw new MojoExecutionException ( e1 . getLocalizedMessage ( ) , e1 ) ; } Xpp3Dom configurationXml = this . mavenHelper . toXpp3Dom ( configuration , getLog ( ) ) ; if ( configurationXml != null ) { configurationXml = Xpp3DomUtils . mergeXpp3Dom ( configurationXml , mojoXml ) ; } else { configurationXml = mojoXml ; } getLog ( ) . debug ( MessageFormat . format ( Messages . AbstractSarlMojo_3 , plugin . getId ( ) , configurationXml . toString ( ) ) ) ; final MojoExecution execution = new MojoExecution ( mojoDescriptor , configurationXml ) ; this . mavenHelper . executeMojo ( execution ) ; }
Execute another MOJO .