maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject [3/3] maven git commit: [MNG-6186] use enhanced HawtJNI library loading (remove previous hack)
Date Tue, 09 May 2017 19:10:20 GMT
[MNG-6186] use enhanced HawtJNI library loading (remove previous hack)

Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/6182a208
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/6182a208
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/6182a208

Branch: refs/heads/master
Commit: 6182a2083fdb9964ccb5250fb85223e38485bf04
Parents: 2a79d1e
Author: Hervé Boutemy <hboutemy@apache.org>
Authored: Sat May 6 18:28:04 2017 +0200
Committer: Hervé Boutemy <hboutemy@apache.org>
Committed: Tue May 9 21:08:13 2017 +0200

----------------------------------------------------------------------
 apache-maven/src/bin/mvn                        |  4 +-
 apache-maven/src/bin/mvn.cmd                    |  1 +
 .../java/org/apache/maven/cli/MavenCli.java     | 59 --------------------
 3 files changed, 4 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/6182a208/apache-maven/src/bin/mvn
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index eedd344..525b2ef 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -193,5 +193,7 @@ exec "$JAVACMD" \
   $MAVEN_DEBUG_OPTS \
   -classpath "${CLASSWORLDS_JAR}" \
   "-Dclassworlds.conf=${MAVEN_HOME}/bin/m2.conf" \
-  "-Dmaven.home=${MAVEN_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}"
\
+  "-Dmaven.home=${MAVEN_HOME}" \
+  "-Dlibrary.jansi.path=${MAVEN_HOME}/jansi-native" \
+  "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
   ${CLASSWORLDS_LAUNCHER} "$@"

http://git-wip-us.apache.org/repos/asf/maven/blob/6182a208/apache-maven/src/bin/mvn.cmd
----------------------------------------------------------------------
diff --git a/apache-maven/src/bin/mvn.cmd b/apache-maven/src/bin/mvn.cmd
index bfcc1b5..ba61f80 100644
--- a/apache-maven/src/bin/mvn.cmd
+++ b/apache-maven/src/bin/mvn.cmd
@@ -181,6 +181,7 @@ set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
   -classpath %CLASSWORLDS_JAR% ^
   "-Dclassworlds.conf=%MAVEN_HOME%\bin\m2.conf" ^
   "-Dmaven.home=%MAVEN_HOME%" ^
+  "-Dlibrary.jansi.path=%MAVEN_HOME%\jansi-native" ^
   "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
   %CLASSWORLDS_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
 if ERRORLEVEL 1 goto error

http://git-wip-us.apache.org/repos/asf/maven/blob/6182a208/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
----------------------------------------------------------------------
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index 79ab45d..e1e58c8 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -188,7 +188,6 @@ public class MavenCli
     {
         MavenCli cli = new MavenCli();
 
-        prepareJansiNative();
         MessageUtils.systemInstall();
         int result = cli.doMain( new CliRequest( args, classWorld ) );
         MessageUtils.systemUninstall();
@@ -196,64 +195,6 @@ public class MavenCli
         return result;
     }
 
-    /**
-     * temporary method while improvement reported to JAnsi+HawtJNI and integrated:
-     * library.jansi.path should point to lib/jansi-native and HawtJNI should be able to
detect
-     * the platform instead of forcing the user having to point library.jansi.path to
-     * lib/jansi-native/[platform]
-     */
-    private static void prepareJansiNative()
-    {
-        if ( System.getProperty( "library.jansi.path" ) == null )
-        {
-            String mavenHome = System.getProperty( "maven.home" );
-
-            if ( mavenHome != null )
-            {
-                File jansiNative = new File( mavenHome, "lib/jansi-native/" + hawtJNIgetPlatform()
);
-                System.setProperty( "library.jansi.path", jansiNative.getAbsolutePath() );
-            }
-        }
-    }
-
-    private static String hawtJNIgetOperatingSystem()
-    {
-        String name = System.getProperty( "os.name" ).toLowerCase().trim();
-        if ( name.startsWith( "linux" ) )
-        {
-            return "linux";
-        }
-        if ( name.startsWith( "mac os x" ) )
-        {
-            return "osx";
-        }
-        if ( name.startsWith( "win" ) )
-        {
-            return "windows";
-        }
-        return name.replaceAll( "\\W+", "_" );
-
-    }
-
-    private static String hawtJNIgetPlatform()
-    {
-        return hawtJNIgetOperatingSystem() + hawtJNIgetBitModel();
-    }
-
-    private static int hawtJNIgetBitModel()
-    {
-        String prop = System.getProperty( "sun.arch.data.model" );
-        if ( prop == null )
-        {
-            prop = System.getProperty( "com.ibm.vm.bitmode" );
-        }
-        if ( prop != null )
-        {
-            return Integer.parseInt( prop );
-        }
-        return -1; // we don't know..
-    }
-
     // TODO need to externalize CliRequest
     public static int doMain( String[] args, ClassWorld classWorld )
     {


Mime
View raw message