public void run ( ) throws MojoExecutionException { if ( skip ) { return ; } if ( tasks == null || tasks . isEmpty ( ) ) { getLog ( ) . warn ( "No Node.js tasks have been defined. Nothing to do." ) ; } // validate nodejs version ComparableVersion nodeJsVersionComparable = new ComparableVersion ( nodeJsVersion ) ; if ( nodeJsVersionComparable . compareTo ( NODEJS_MIN_VERSION ) < 0 ) { throw new MojoExecutionException ( "This plugin supports Node.js " + NODEJS_MIN_VERSION + " and up." ) ; } NodeInstallationInformation information = getOrInstallNodeJS ( ) ; if ( tasks != null ) { for ( Task task : tasks ) { task . setLog ( getLog ( ) ) ; task . execute ( information ) ; } } }
Installs node js if necessary and performs defined tasks