public Map < String , Lifecycle > getPhaseToLifecycleMap ( ) throws LifecycleExecutionException { if ( phaseToLifecycleMap == null ) { phaseToLifecycleMap = new HashMap < String , Lifecycle > ( ) ; for ( Lifecycle lifecycle : lifecycles ) { @ SuppressWarnings ( "unchecked" ) List < String > phases = lifecycle . getPhases ( ) ; for ( String phase : phases ) { if ( phaseToLifecycleMap . containsKey ( phase ) ) { Lifecycle prevLifecycle = ( Lifecycle ) phaseToLifecycleMap . get ( phase ) ; throw new LifecycleExecutionException ( "Phase '" + phase + "' is defined in more than one lifecycle: '" + lifecycle . getId ( ) + "' and '" + prevLifecycle . getId ( ) + "'" ) ; } else { phaseToLifecycleMap . put ( phase , lifecycle ) ; } } } } return phaseToLifecycleMap ; }
Gets the phase to lifecycle map .