You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by GitBox <gi...@apache.org> on 2022/03/14 18:25:42 UTC

[GitHub] [sling-feature-launcher-maven-plugin] enapps-enorman commented on a change in pull request #4: SLING-11158 use feature launcher assembly to launch

enapps-enorman commented on a change in pull request #4:
URL: https://github.com/apache/sling-feature-launcher-maven-plugin/pull/4#discussion_r826257664



##########
File path: src/main/java/org/apache/sling/maven/feature/launcher/StartMojo.java
##########
@@ -124,24 +171,58 @@ public void execute() throws MojoExecutionException, MojoFailureException {
                 File featureFile = result.getArtifact().getFile();
                 
                 List<String> args = new ArrayList<>();
-                String javahome = System.getenv("JAVA_HOME");
-                if (javahome == null || javahome.isEmpty()) {
-                    // SLING-9843 fallback to java.home system property if JAVA_HOME env variable is not set
-                    getLog().warn("The JAVA_HOME env variable was not set, falling back to the java.home system property");
-                    javahome = System.getProperty("java.home");
-                }
-                args.add(javahome + File.separatorChar + "bin" + File.separatorChar + "java");
-                // SLING-9994 - if any extra vm options were supplied, apply them here
-                String[] vmOptions = launch.getLauncherArguments().getVmOptions();
-                if (vmOptions != null) {
-                    for (String vmOption : vmOptions) {
-                        if (vmOption != null && !vmOption.isEmpty()) {
-                            args.add(vmOption);
+                if (useAssembly) {

Review comment:
       Yes the launcher script does have some logic for finding where the java executable is.  But thinking more about this more, it probably wouldn't hurt to set the JAVA_HOME env variable here to deal with things like SLING-9843
   
   I''ll make that change.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org