Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-1641

Avoid embedding jline in the console

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • karaf
    • None

    Description

      We currently embed jline, jansi and gogo into the console.

      This has some disadvantages:

      • For jline and jansi we have to care about all the native libs in our build of console
      • By embedding we are breaking the encapsulation of the bundles we embed. So there is the risk we are using internal stuff that is likely to change
      • There are some problems with Eclipse and m2eclipse in the ide. So when the console project is open all projects that depend on it fail

      So I have digged into this recently.

      We were using our own interceptor to start gogo to install the Ansiconsole and to implement system property replacement. The Ansiconsole installation seems to be not necessary since we intorduced the rewrapping of streams. So I was able to remove this. Instead of the system property replacement I simply now copy the system properties as session variables at start of a shell.

      So after these changes I was able to remove the embedding of jline and jansi.

      When using jline as a bundle I found two issues with it:

      • The Manifest of jline 2.7 is wrong it imports an internal package from jansi that is not exported. Additionally jansi is embedded in jline so this was not necessary
      • Jline 2.7 embeds jansi 1.8 while we use 1.9 in karaf
        Fortunately Guillaume fixed these issues so 2.8-SNAPSHOT works nicely as a bundle.

      One thing about gogo remains. We use some classes from gogo.runtime which are not exported. So we still need to embed gogo.

      Attachments

        Activity

          People

            cschneider Christian Schneider
            cschneider Christian Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: