protected Map < String , String > getEnv ( boolean prePackagePhase ) throws MojoExecutionException { Map < String , String > ret = new HashMap <> ( ) ; if ( ! isFatJar ( ) ) { String mainClass = getConfig ( Config . mainClass ) ; if ( mainClass == null ) { mainClass = mainClassDetector . getMainClass ( ) ; if ( mainClass == null ) { if ( ! prePackagePhase ) { throw new MojoExecutionException ( "Cannot extract main class to startup" ) ; } } } if ( mainClass != null ) { log . verbose ( "Detected main class %s" , mainClass ) ; ret . put ( JAVA_MAIN_CLASS_ENV_VAR , mainClass ) ; } } List < String > javaOptions = getExtraJavaOptions ( ) ; if ( javaOptions . size ( ) > 0 ) { ret . put ( JAVA_OPTIONS , StringUtils . join ( javaOptions . iterator ( ) , " " ) ) ; } return ret ; }
Hook for adding extra environment vars