diff options
Diffstat (limited to 'src/main/java/org/apache/maven')
-rw-r--r-- | src/main/java/org/apache/maven/plugin/nar/NarManager.java | 2 | ||||
-rw-r--r-- | src/main/java/org/apache/maven/plugin/nar/NarUtil.java | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/org/apache/maven/plugin/nar/NarManager.java b/src/main/java/org/apache/maven/plugin/nar/NarManager.java index 087bdee..13a464f 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarManager.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarManager.java @@ -381,7 +381,7 @@ public class NarManager try { unpackNar( manager, file, narLocation ); - if ( !NarUtil.getOS( os ).equals( "Windows" ) ) + if ( !NarUtil.getOS( os ).equals( OS.WINDOWS ) ) { NarUtil.makeExecutable( new File( narLocation, "bin/" + defaultAOL ), log ); // FIXME clumsy diff --git a/src/main/java/org/apache/maven/plugin/nar/NarUtil.java b/src/main/java/org/apache/maven/plugin/nar/NarUtil.java index 323dde7..4012db6 100644 --- a/src/main/java/org/apache/maven/plugin/nar/NarUtil.java +++ b/src/main/java/org/apache/maven/plugin/nar/NarUtil.java @@ -68,11 +68,12 @@ public class NarUtil if ( os == null ) { os = System.getProperty( "os.name" ); - if ( os.startsWith( "Windows" ) ) + String name = os.toLowerCase(); + if ( name.startsWith( "windows" ) ) os = OS.WINDOWS; - if ( os.startsWith( "windows" ) ) - os = OS.WINDOWS; - if ( os.equals( "Mac OS X" ) ) + if ( name.startsWith( "linux" ) ) + os = OS.LINUX; + if ( name.equals( "mac os x" ) ) os = OS.MACOSX; } return os; @@ -128,7 +129,7 @@ public class NarUtil if ( javaHome == null ) { javaHome = new File( System.getProperty( "java.home" ) ); - if ( !getOS( os ).equals( "MacOSX" ) ) + if ( !getOS( os ).equals( OS.MACOSX ) ) { javaHome = new File( javaHome, ".." ); } |