generator/java-exec/src/main/java/io/fabric8/maven/generator/javaexec/JavaExecGenerator.java
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;
    }
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;
    }
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

@return map with environment variables to use
@param prePackagePhase
Hook for adding extra environment vars