diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java index aabd526f..fbee9fd8 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java +++ b/src/main/java/io/openliberty/tools/common/plugins/util/DevUtil.java @@ -1328,9 +1328,12 @@ private void checkDockerBuildTime(long startTime, File dockerBuildContext) { private void startContainer() { try { - if (OSUtil.isLinux()) { + if (OSUtil.isLinux() || OSUtil.isMac()) { // Added Mac since started getting permission errors for logs folder // Allow the server to write to the log files. If we don't create it here docker daemon will create it as root. runCmd("mkdir -p " + serverDirectory + "/logs"); + // Added two hidden folders since started getting permissions errors on the dropins folder. + runCmd("mkdir -p " + buildDirectory + "/" + DEVC_HIDDEN_FOLDER + "/apps"); + runCmd("mkdir -p " + buildDirectory + "/" + DEVC_HIDDEN_FOLDER + "/dropins"); } info("Starting Docker container..."); diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/OSUtil.java b/src/main/java/io/openliberty/tools/common/plugins/util/OSUtil.java index a18425be..69f577e5 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/util/OSUtil.java +++ b/src/main/java/io/openliberty/tools/common/plugins/util/OSUtil.java @@ -1,5 +1,5 @@ /** - * (C) Copyright IBM Corporation 2018, 2020. + * (C) Copyright IBM Corporation 2018, 2023. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,4 +38,14 @@ public static boolean isLinux() { return osName.indexOf("linux") >= 0; } + /** + * Determines if the current OS is a MAC OS. + * + * @return true if running on Linux, false otherwise + */ + public static boolean isMac() { + String osName = System.getProperty("os.name", "unknown").toLowerCase(); + return osName.indexOf("mac") >= 0; + } + } diff --git a/src/main/java/io/openliberty/tools/common/plugins/util/VersionUtility.java b/src/main/java/io/openliberty/tools/common/plugins/util/VersionUtility.java index 45a48e11..9e10460a 100644 --- a/src/main/java/io/openliberty/tools/common/plugins/util/VersionUtility.java +++ b/src/main/java/io/openliberty/tools/common/plugins/util/VersionUtility.java @@ -50,6 +50,7 @@ public static int compareArtifactVersion(String currentVersion, String compareVe Version minVersion = new Version(majorVersion, minorVersion, patchLevel, null, null, null); // check for and strip off any classifier + currentVersion = currentVersion.trim(); // guard against trailing blank space if (currentVersion.contains("-")) { currentVersion = currentVersion.substring(0, currentVersion.indexOf("-")); }