From 61bb4fb517904e732a873dfe140cd18cb5b42a0d Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Mon, 7 Nov 2022 20:49:13 +0900 Subject: [PATCH] Detect more `osx` variants Motivation: It looks like some JDK implementations do neither return `macosx` or `osx` for `System.getProperty("os.arch")`. Modifications: - Return `osx` when `os.arch` starts with `mac` instead of `macosx`, so that the plugin detects both `mac` and `macosx`. Result: - Fixes #58 --- README.md | 2 +- src/main/java/kr/motd/maven/os/Detector.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 74e85d9..7bc4520 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ * `hpux` - if the value starts with `hpux` * `os400` - if the value starts with `os400` and its following character is *not* a digit (e.g. `os4000`) * `linux` - if the value starts with `linux` -* `osx` - if the value starts with `macosx` or `osx` +* `osx` - if the value starts with `mac` or `osx` * `freebsd` - if the value starts with `freebsd` * `openbsd` - if the value starts with `openbsd` * `netbsd` - if the value starts with `netbsd` diff --git a/src/main/java/kr/motd/maven/os/Detector.java b/src/main/java/kr/motd/maven/os/Detector.java index 0ef5cbc..769e47b 100644 --- a/src/main/java/kr/motd/maven/os/Detector.java +++ b/src/main/java/kr/motd/maven/os/Detector.java @@ -164,7 +164,7 @@ private static String normalizeOs(String value) { if (value.startsWith("linux")) { return "linux"; } - if (value.startsWith("macosx") || value.startsWith("osx")) { + if (value.startsWith("mac") || value.startsWith("osx")) { return "osx"; } if (value.startsWith("freebsd")) {