You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2016/09/17 18:43:27 UTC

karaf git commit: Upgrade to jline 3.0.0.M2

Repository: karaf
Updated Branches:
  refs/heads/master 3efba8e93 -> c874e4795


Upgrade to jline 3.0.0.M2

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

Branch: refs/heads/master
Commit: c874e479503225f1d2c977219620f374384ac047
Parents: 3efba8e
Author: Guillaume Nodet <gn...@apache.org>
Authored: Sat Sep 17 20:38:43 2016 +0200
Committer: Guillaume Nodet <gn...@apache.org>
Committed: Sat Sep 17 20:43:18 2016 +0200

----------------------------------------------------------------------
 .../filtered-resources/resources/bin/client     |  2 +-
 .../filtered-resources/resources/bin/client.bat |  2 +-
 .../main/filtered-resources/resources/bin/shell |  2 +-
 .../filtered-resources/resources/bin/shell.bat  |  2 +-
 assemblies/features/framework/pom.xml           |  6 ++--
 .../standard/src/main/feature/feature.xml       |  2 +-
 client/pom.xml                                  |  2 +-
 etc/appended-resources/supplemental-models.xml  |  2 +-
 pom.xml                                         |  4 +--
 shell/console/pom.xml                           |  2 +-
 shell/core/pom.xml                              |  2 +-
 .../impl/console/osgi/LocalConsoleManager.java  | 30 +++++++++++---------
 .../shell/impl/console/parsing/KarafParser.java |  3 +-
 webconsole/gogo/pom.xml                         |  2 +-
 14 files changed, 33 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/assemblies/features/base/src/main/filtered-resources/resources/bin/client
----------------------------------------------------------------------
diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/client b/assemblies/features/base/src/main/filtered-resources/resources/bin/client
index 1012fcc..0de9784 100755
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/client
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/client
@@ -272,7 +272,7 @@ setupDefaults() {
     # Add the jars in the lib dir
     CLASSPATH="$KARAF_HOME/system/org/apache/karaf/org.apache.karaf.client/${project.version}/org.apache.karaf.client-${project.version}.jar"
     CLASSPATH="$CLASSPATH:$KARAF_HOME/system/org/apache/sshd/sshd-core/${sshd.version}/sshd-core-${sshd.version}.jar"
-    CLASSPATH="$CLASSPATH:$KARAF_HOME/system/jline/jline/${jline.version}/jline-${jline.version}.jar"
+    CLASSPATH="$CLASSPATH:$KARAF_HOME/system/org/jline/jline/${jline.version}/jline-${jline.version}.jar"
     CLASSPATH="$CLASSPATH:$KARAF_HOME/system/org/slf4j/slf4j-api/${slf4j.version}/slf4j-api-${slf4j.version}.jar"
 
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/assemblies/features/base/src/main/filtered-resources/resources/bin/client.bat
----------------------------------------------------------------------
diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/client.bat b/assemblies/features/base/src/main/filtered-resources/resources/bin/client.bat
index e613bbe..ff914c8 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/client.bat
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/client.bat
@@ -117,7 +117,7 @@ if "%EXTRA_JAVA_OPTS%" == "" goto :KARAF_EXTRA_JAVA_OPTS_END
 
 set CLASSPATH=%KARAF_HOME%\system\org\apache\karaf\org.apache.karaf.client\${project.version}\org.apache.karaf.client-${project.version}.jar
 set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\org\apache\sshd\sshd-core\${sshd.version}\sshd-core-${sshd.version}.jar
-set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\jline\jline\${jline.version}\jline-${jline.version}.jar
+set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\org\jline\jline\${jline.version}\jline-${jline.version}.jar
 set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\org\slf4j\slf4j-api\${slf4j.version}\slf4j-api-${slf4j.version}.jar
 
 :EXECUTE

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/assemblies/features/base/src/main/filtered-resources/resources/bin/shell
----------------------------------------------------------------------
diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/shell b/assemblies/features/base/src/main/filtered-resources/resources/bin/shell
index cbdbfc3..fcd7062 100755
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/shell
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/shell
@@ -294,7 +294,7 @@ setupDefaults() {
     # Setup classpath
     CLASSPATH="$KARAF_HOME/system/org/apache/karaf/shell/org.apache.karaf.shell.core/${project.version}/org.apache.karaf.shell.core-${project.version}.jar"
     CLASSPATH="$CLASSPATH:$KARAF_HOME/system/org/ops4j/pax/logging/pax-logging-api/${pax.logging.version}/pax-logging-api-${pax.logging.version}.jar"
-    CLASSPATH="$CLASSPATH:$KARAF_HOME/system/jline/jline/${jline.version}/jline-${jline.version}.jar"
+    CLASSPATH="$CLASSPATH:$KARAF_HOME/system/org/jline/jline/${jline.version}/jline-${jline.version}.jar"
 
     DEFAULT_JAVA_DEBUG_PORT="5005"
     if [ "x$JAVA_DEBUG_PORT" = "x" ]; then

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/assemblies/features/base/src/main/filtered-resources/resources/bin/shell.bat
----------------------------------------------------------------------
diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/shell.bat b/assemblies/features/base/src/main/filtered-resources/resources/bin/shell.bat
index 7bd875f..382bb7c 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/bin/shell.bat
+++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/shell.bat
@@ -127,7 +127,7 @@ if "%KARAF_DEBUG%" == "" goto :KARAF_DEBUG_END
 
 set CLASSPATH=%KARAF_HOME%\system\org\apache\karaf\shell\org.apache.karaf.shell.core\${project.version}\org.apache.karaf.shell.core-${project.version}.jar
 set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\org\ops4j\pax\logging\pax-logging-api\${pax.logging.version}\pax-logging-api-${pax.logging.version}.jar
-set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\jline\jline\${jline.version}\jline-${jline.version}.jar
+set CLASSPATH=%CLASSPATH%;%KARAF_HOME%\system\org\jline\jline\${jline.version}\jline-${jline.version}.jar
 
 :EXECUTE
     if "%SHIFT%" == "true" SET ARGS=%2 %3 %4 %5 %6 %7 %8

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/assemblies/features/framework/pom.xml
----------------------------------------------------------------------
diff --git a/assemblies/features/framework/pom.xml b/assemblies/features/framework/pom.xml
index 9f4a19f..30236c6 100644
--- a/assemblies/features/framework/pom.xml
+++ b/assemblies/features/framework/pom.xml
@@ -82,7 +82,7 @@
 
         <!-- Client deps -->
         <dependency>
-            <groupId>jline</groupId>
+            <groupId>org.jline</groupId>
             <artifactId>jline</artifactId>
         </dependency>
 
@@ -232,9 +232,9 @@
                         <configuration>
                             <artifactItems>
                                 <artifactItem>
-                                    <groupId>jline</groupId>
+                                    <groupId>org.jline</groupId>
                                     <artifactId>jline</artifactId>
-                                    <outputDirectory>target/classes/resources/system/jline/jline/${jline.version}</outputDirectory>
+                                    <outputDirectory>target/classes/resources/system/org/jline/jline/${jline.version}</outputDirectory>
                                 </artifactItem>
                                 <artifactItem>
                                     <groupId>org.slf4j</groupId>

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/assemblies/features/standard/src/main/feature/feature.xml
----------------------------------------------------------------------
diff --git a/assemblies/features/standard/src/main/feature/feature.xml b/assemblies/features/standard/src/main/feature/feature.xml
index 7b75dd9..bd11a25 100644
--- a/assemblies/features/standard/src/main/feature/feature.xml
+++ b/assemblies/features/standard/src/main/feature/feature.xml
@@ -102,7 +102,7 @@
             java = admin
         </config>
         <bundle dependency="true" start-level="30">mvn:org.fusesource.jansi/jansi/${jansi.version}</bundle>
-        <bundle dependency="true" start-level="30">mvn:jline/jline/${jline.version}</bundle>
+        <bundle dependency="true" start-level="30">mvn:org.jline/jline/${jline.version}</bundle>
         <bundle start-level="30">mvn:org.apache.karaf.shell/org.apache.karaf.shell.core/${project.version}</bundle>
         <bundle start-level="30">mvn:org.apache.karaf.shell/org.apache.karaf.shell.commands/${project.version}</bundle>
     </feature>

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index e60387a..a9ba92a 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -39,7 +39,7 @@
 
     <dependencies>
         <dependency>
-            <groupId>jline</groupId>
+            <groupId>org.jline</groupId>
             <artifactId>jline</artifactId>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/etc/appended-resources/supplemental-models.xml
----------------------------------------------------------------------
diff --git a/etc/appended-resources/supplemental-models.xml b/etc/appended-resources/supplemental-models.xml
index d1ee598..2924605 100644
--- a/etc/appended-resources/supplemental-models.xml
+++ b/etc/appended-resources/supplemental-models.xml
@@ -888,7 +888,7 @@
   </supplement>
   <supplement>
     <project>
-      <groupId>jline</groupId>
+      <groupId>org.jline</groupId>
       <artifactId>jline</artifactId>
       <name>JLine</name>
       <url>http://jline.sourceforge.net</url>

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f5bbcc9..716b9c2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -252,7 +252,7 @@
         <hibernate.validator.version>5.2.4.Final</hibernate.validator.version>
         <jansi.version>1.12</jansi.version>
         <javassist.version>3.9.0.GA</javassist.version>
-        <jline.version>3.0.0.M1</jline.version>
+        <jline.version>3.0.0.M2</jline.version>
         <jsw.version>3.2.3</jsw.version>
         <log4j.version>1.2.17</log4j.version>
         <maven.version>2.0.9</maven.version>
@@ -1210,7 +1210,7 @@
                 <version>${jansi.version}</version>
             </dependency>
             <dependency>
-                <groupId>jline</groupId>
+                <groupId>org.jline</groupId>
                 <artifactId>jline</artifactId>
                 <version>${jline.version}</version>
             </dependency>

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/shell/console/pom.xml
----------------------------------------------------------------------
diff --git a/shell/console/pom.xml b/shell/console/pom.xml
index 498a619..45804c4 100644
--- a/shell/console/pom.xml
+++ b/shell/console/pom.xml
@@ -44,7 +44,7 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>jline</groupId>
+            <groupId>org.jline</groupId>
             <artifactId>jline</artifactId>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/shell/core/pom.xml
----------------------------------------------------------------------
diff --git a/shell/core/pom.xml b/shell/core/pom.xml
index 5e5f5a2..356029e 100644
--- a/shell/core/pom.xml
+++ b/shell/core/pom.xml
@@ -44,7 +44,7 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>jline</groupId>
+            <groupId>org.jline</groupId>
             <artifactId>jline</artifactId>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java
----------------------------------------------------------------------
diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java
index a8f1d25..8a307d0 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/osgi/LocalConsoleManager.java
@@ -31,6 +31,7 @@ import org.apache.karaf.shell.api.console.SessionFactory;
 import org.apache.karaf.shell.impl.console.JLineTerminal;
 import org.apache.karaf.shell.support.ShellUtil;
 import org.apache.karaf.util.jaas.JaasHelper;
+import org.jline.terminal.Terminal;
 import org.jline.terminal.TerminalBuilder;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
@@ -56,20 +57,11 @@ public class LocalConsoleManager {
     }
 
     public void start() throws Exception {
-        final org.jline.terminal.Terminal terminal = TerminalBuilder.terminal();
-        final Runnable callback = new Runnable() {
-            public void run() {
-                try {
-                    if (!closing) {
-                        bundleContext.getBundle(0).stop();
-                    }
-                } catch (Exception e) {
-                    // Ignore
-                }
-            }
-        };
+        final Terminal terminal = TerminalBuilder.builder()
+                .nativeSignals(true)
+                .signalHandler(Terminal.SignalHandler.SIG_IGN)
+                .build();
 
-        
         final Subject subject = createLocalKarafSubject();    
         this.session = JaasHelper.doAs(subject, new PrivilegedAction<Session>() {
             public Session run() {
@@ -80,7 +72,7 @@ public class LocalConsoleManager {
                                       new PrintStream(terminal.output()),
                                       new JLineTerminal(terminal),
                                       encoding, 
-                                      callback);
+                                      LocalConsoleManager.this::close);
                 registration = bundleContext.registerService(Session.class, session, null);
                 String name = "Karaf local console user " + ShellUtil.getCurrentUserName();
                 boolean delayconsole = Boolean.parseBoolean(System.getProperty(KARAF_DELAY_CONSOLE));
@@ -164,4 +156,14 @@ public class LocalConsoleManager {
         }
     }
 
+    protected void close() {
+        try {
+            if (!closing) {
+                bundleContext.getBundle(0).stop();
+            }
+        } catch (Exception e) {
+            // Ignore
+        }
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/shell/core/src/main/java/org/apache/karaf/shell/impl/console/parsing/KarafParser.java
----------------------------------------------------------------------
diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/parsing/KarafParser.java b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/parsing/KarafParser.java
index 334e960..ce8972f 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/parsing/KarafParser.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/parsing/KarafParser.java
@@ -43,7 +43,8 @@ public class KarafParser implements org.jline.reader.Parser {
         this.session = session;
     }
 
-    public ParsedLine parse(String line, int cursor) throws org.jline.reader.SyntaxError {
+    @Override
+    public ParsedLine parse(String line, int cursor, ParseContext parseContext) throws SyntaxError {
         try {
             return doParse(line, cursor);
         } catch (EOFError e) {

http://git-wip-us.apache.org/repos/asf/karaf/blob/c874e479/webconsole/gogo/pom.xml
----------------------------------------------------------------------
diff --git a/webconsole/gogo/pom.xml b/webconsole/gogo/pom.xml
index 566f272..f117a25 100644
--- a/webconsole/gogo/pom.xml
+++ b/webconsole/gogo/pom.xml
@@ -83,7 +83,7 @@
             <artifactId>org.apache.karaf.shell.console</artifactId>
         </dependency>
         <dependency>
-            <groupId>jline</groupId>
+            <groupId>org.jline</groupId>
             <artifactId>jline</artifactId>
         </dependency>
         <dependency>