private void checkConfiguration ( ) throws MojoExecutionException { checkDependencyFilenameStrategy ( ) ; if ( CollectionUtils . isEmpty ( jnlpFiles ) ) { throw new MojoExecutionException ( "Configuration error: At least one <jnlpFile> element must be specified" ) ; } if ( jnlpFiles . size ( ) == 1 && StringUtils . isEmpty ( jnlpFiles . get ( 0 ) . getOutputFilename ( ) ) ) { getLog ( ) . debug ( "Jnlp output file name not specified in single set of jnlpFiles. " + "Using default output file name: launch.jnlp." ) ; jnlpFiles . get ( 0 ) . setOutputFilename ( "launch.jnlp" ) ; } // --- // check Jnlp files configuration // --- Set < String > filenames = new LinkedHashSet <> ( jnlpFiles . size ( ) ) ; for ( JnlpFile jnlpFile : jnlpFiles ) { if ( ! filenames . add ( jnlpFile . getOutputFilename ( ) ) ) { throw new MojoExecutionException ( "Configuration error: Unique JNLP filenames must be provided. " + "The following file name appears more than once [" + jnlpFile . getOutputFilename ( ) + "]." ) ; } checkJnlpFileConfiguration ( jnlpFile ) ; } if ( CollectionUtils . isNotEmpty ( commonJarResources ) ) { // --- // --- checkCommonJarResources(); // --- for ( JarResource jarResource : commonJarResources ) { checkMandatoryJarResourceFields ( jarResource ) ; if ( jarResource . getMainClass ( ) != null ) { throw new MojoExecutionException ( "Configuration Error: A mainClass must not be specified " + "on a JarResource in the commonJarResources collection." ) ; } } // --- // check for duplicate jar resources // Checks that any jarResources defined in the jnlpFile elements are not also defined in // commonJarResources. // --- for ( JnlpFile jnlpFile : jnlpFiles ) { for ( JarResource jarResource : jnlpFile . getJarResources ( ) ) { if ( commonJarResources . contains ( jarResource ) ) { String message = "Configuration Error: The jar resource element for artifact " + jarResource + " defined in common jar resources is duplicated in the jar " + "resources configuration of the jnlp file identified by the template file " + jnlpFile . getInputTemplate ( ) + "." ; throw new MojoExecutionException ( message ) ; } } } } }
Confirms that all plugin configuration provided by the user in the pom . xml file is valid .