public static List < BuildPlatform > validatePlatforms ( List < BuildPlatform > platforms ) throws MojoExecutionException { if ( platforms == null ) { platforms = new ArrayList < BuildPlatform > ( ) ; platforms . add ( new BuildPlatform ( ) ) ; } else { Set < String > platformNames = new HashSet < String > ( ) ; for ( BuildPlatform platform : platforms ) { if ( platformNames . contains ( platform . getName ( ) ) ) { throw new MojoExecutionException ( "Duplicate platform '" + platform . getName ( ) + "' in configuration, platform names must be unique" ) ; } platformNames . add ( platform . getName ( ) ) ; platform . identifyPrimaryConfiguration ( ) ; } } return platforms ; }
Check that we have a valid set of platforms . If no platforms are configured we create 1 default platform .