public void identifyPrimaryConfiguration ( ) throws MojoExecutionException { Set < String > configurationNames = new HashSet < String > ( ) ; for ( BuildConfiguration configuration : configurations ) { if ( configurationNames . contains ( configuration . getName ( ) ) ) { throw new MojoExecutionException ( "Duplicate configuration '" + configuration . getName ( ) + "' for '" + getName ( ) + "', configuration names must be unique" ) ; } configurationNames . add ( configuration . getName ( ) ) ; configuration . setPrimary ( false ) ; } if ( configurations . contains ( RELEASE_CONFIGURATION ) ) { configurations . get ( configurations . indexOf ( RELEASE_CONFIGURATION ) ) . setPrimary ( true ) ; } else if ( configurations . contains ( DEBUG_CONFIGURATION ) ) { configurations . get ( configurations . indexOf ( DEBUG_CONFIGURATION ) ) . setPrimary ( true ) ; } else { configurations . get ( 0 ) . setPrimary ( true ) ; } }
Check the configurations and mark one as primary .