public void callPluginGoal ( String fullGoal ) throws MojoFailureException , MojoExecutionException { String [ ] parts = splitGoalSpec ( fullGoal ) ; Plugin plugin = project . getPlugin ( parts [ 0 ] ) ; String goal = parts [ 1 ] ; if ( plugin == null ) { throw new MojoFailureException ( "No goal " + fullGoal + " found in pom.xml" ) ; } try { String executionId = null ; if ( goal != null && goal . length ( ) > 0 && goal . indexOf ( ' ' ) > - 1 ) { int pos = goal . indexOf ( ' ' ) ; executionId = goal . substring ( pos + 1 ) ; goal = goal . substring ( 0 , pos ) ; } PluginDescriptor pluginDescriptor = getPluginDescriptor ( project , plugin ) ; MojoDescriptor mojoDescriptor = pluginDescriptor . getMojo ( goal ) ; if ( mojoDescriptor == null ) { throw new MojoExecutionException ( "Could not find goal '" + goal + "' in plugin " + plugin . getGroupId ( ) + ":" + plugin . getArtifactId ( ) + ":" + plugin . getVersion ( ) ) ; } MojoExecution exec = getMojoExecution ( executionId , mojoDescriptor ) ; pluginManager . executeMojo ( session , exec ) ; } catch ( Exception e ) { throw new MojoExecutionException ( "Unable to execute mojo" , e ) ; } }
Call another goal after restart has finished