Skip to content

Console and Cli rewrite for org.jline:jline:3.0.0-3.27.1+ #13752

Closed

Description

@jamesfredley

#13474 trigged this issue and it was resolved for now, by #13801 (review)

jansi 1.18 also results in the following on Java 24

WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::loadLibrary has been called by org.fusesource.hawtjni.runtime.Library in an unnamed module (file:/C:/Users/james/.gradle/caches/modules-2/files-2.1/org.fusesource.jansi/jansi/1.18/d9205bbcd4b5f9cd1effe752d18f73bd942d783f/jansi-1.18.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

https://mvnrepository.com/artifact/jline/jline/2.14.6 is not compatible with https://mvnrepository.com/artifact/org.fusesource.jansi/jansi/2.4.1

Moving to https://mvnrepository.com/artifact/org.jline/jline/3.0.0 - https://mvnrepository.com/artifact/org.jline/jline/3.27.1 will require a rewrite of:

grails.build.logging.GrailsConsole
grails.build.logging.GrailsEclipseConsole
org.grails.build.interactive.CandidateListCompletionHandler
org.grails.cli.GrailsCli
org.grails.cli.*.*

Issue description

org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not complete execution for Gradle Test Executor 13.
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:65)
	at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:92)
	at jdk.proxy1/jdk.proxy1.$Proxy4.stop(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$3.run(TestWorker.java:200)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:132)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:103)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:63)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:121)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
	at app//worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at app//worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: org.junit.platform.commons.JUnitException: TestEngine with ID 'spock' failed to discover tests
	at app//org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:160)
	at app//org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverSafely(EngineDiscoveryOrchestrator.java:132)
	at app//org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:107)
	at app//org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discover(EngineDiscoveryOrchestrator.java:78)
	at app//org.junit.platform.launcher.core.DefaultLauncher.discover(DefaultLauncher.java:99)
	at app//org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85)
	at app//org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:124)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:99)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:94)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:63)
	... 18 more
Caused by: java.lang.NoSuchMethodError: 'java.io.OutputStream org.fusesource.jansi.AnsiConsole.wrapOutputStream(java.io.OutputStream)'
	at jline.AnsiWindowsTerminal.detectAnsiSupport(AnsiWindowsTerminal.java:57)
	at jline.AnsiWindowsTerminal.<init>(AnsiWindowsTerminal.java:27)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128)
	at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347)
	at java.base/java.lang.Class.newInstance(Class.java:645)
	at jline.TerminalFactory.getFlavor(TerminalFactory.java:205)
	at jline.TerminalFactory.create(TerminalFactory.java:96)
	at jline.TerminalFactory.get(TerminalFactory.java:180)
	at jline.TerminalFactory.get(TerminalFactory.java:186)
	at jline.console.ConsoleReader.<init>(ConsoleReader.java:244)
	at jline.console.ConsoleReader.<init>(ConsoleReader.java:236)
	at jline.console.ConsoleReader.<init>(ConsoleReader.java:228)
	at grails.build.logging.GrailsConsole.createConsoleReader(GrailsConsole.java:247)
	at grails.build.logging.GrailsConsole.initialize(GrailsConsole.java:183)
	at grails.build.logging.GrailsConsole.<init>(GrailsConsole.java:156)
	at grails.build.logging.GrailsConsole.createInstance(GrailsConsole.java:387)
	at grails.build.logging.GrailsConsole.getInstance(GrailsConsole.java:307)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
	at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1989)
	at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3900)
	at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
	at grails.build.logging.GrailsConsoleSpec$_closure1.doCall(GrailsConsoleSpec.groovy:41)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:279)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)
	at groovy.lang.Closure.call(Closure.java:433)
	at groovy.lang.Closure.call(Closure.java:422)
	at org.spockframework.runtime.extension.builtin.ConditionalExtension.evaluateCondition(ConditionalExtension.java:124)
	at org.spockframework.runtime.extension.builtin.ConditionalExtension.evaluateCondition(ConditionalExtension.java:112)
	at org.spockframework.runtime.extension.builtin.ConditionalExtension.visitSpecAnnotation(ConditionalExtension.java:58)
	at org.spockframework.runtime.extension.IAnnotationDrivenExtension.visitSpecAnnotations(IAnnotationDrivenExtension.java:40)
	at org.spockframework.runtime.ExtensionRunner.doRunAnnotationDrivenExtensions(ExtensionRunner.java:124)
	at org.spockframework.runtime.ExtensionRunner.doRunAnnotationDrivenExtensions(ExtensionRunner.java:114)
	at org.spockframework.runtime.ExtensionRunner.runAnnotationDrivenExtensions(ExtensionRunner.java:65)
	at org.spockframework.runtime.ExtensionRunner.runAnnotationDrivenExtensions(ExtensionRunner.java:54)
	at org.spockframework.runtime.ExtensionRunner.run(ExtensionRunner.java:44)
	at org.spockframework.runtime.SpockEngineDiscoveryPostProcessor.processSpecNode(SpockEngineDiscoveryPostProcessor.java:52)
	at org.spockframework.runtime.SpockEngineDiscoveryPostProcessor.lambda$postProcessEngineDescriptor$0(SpockEngineDiscoveryPostProcessor.java:16)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
	at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at org.spockframework.runtime.SpockEngineDiscoveryPostProcessor.postProcessEngineDescriptor(SpockEngineDiscoveryPostProcessor.java:17)
	at org.spockframework.runtime.SpockEngine.discover(SpockEngine.java:31)
	at org.junit.platform.launcher.core.EngineDiscoveryOrchestrator.discoverEngineRoot(EngineDiscoveryOrchestrator.java:152)
	... 28 more

Activity

  1. changed the title [-]Grails 7: java.lang.NoSuchMethodError: 'java.io.OutputStream org.fusesource.jansi.AnsiConsole.wrapOutputStream(java.io.OutputStream)'[/-] [+]Grails 7: Console and Cli rewrite for org.jline:jline:3.0.0-3.27-1[/+] on Oct 22, 2024
  2. changed the title [-]Grails 7: Console and Cli rewrite for org.jline:jline:3.0.0-3.27-1[/-] [+]Grails 7: Console and Cli rewrite for org.jline:jline:3.0.0-3.27.1[/+] on Oct 22, 2024
  3. matrei commented on Oct 23, 2024

    @matrei
    Contributor

    @jamesfredley Where are you getting this error?

  4. jamesfredley commented on Oct 23, 2024

    @jamesfredley
    ContributorAuthor

    @matrei It was before #13801 (review). I also ran into it back when consolidating the versions into gradle.properties and went with jansi 1.18 then as well, due to this error.

    jansi:2.0.0-2.4.1 all trigger it with jline:jline:2.14.6

    I think #13805 (comment) would help avoid OS specific situations when apply updates from dependabot.

  5. codeconsole commented on Nov 24, 2024

    @codeconsole
    Contributor

    Jline 3.27.1 is the current version.

    implementation "org.jline:jline:3.27.1"

    https://github.com/jline/jline3

    t's definitely not a drop-in replacement.
    During development, I haven't considered compatibility as a goal at all, so I changed a lot of APIs. The package have been renamed, a lot of new interfaces have been introduced for various features (Parser, Highlighter...). The completers have changed also to support description, coloring, complete/incomplete, with one main difference is that the completers can return all possibilities, as the console reader will find matching candidates within that list.
    Obtaining a terminal can be done using:

      Terminal terminal = TerminalBuilder.builder()
                  // further customization
                  .builder();
    And the reader using:
       LineReader reader = LineReader.builder()
                 .terminal(terminal)
                  // further customization
                 .build();

    Reading lines is done in the same way using the various readLine() methods.
    https://groups.google.com/g/jline-users/c/ebQxEFUVkKs

    More upgrade discussion:
    https://groups.google.com/g/jline-users/c/PEWgDPSOUt4/m/2qU63kgWDAAJ

  6. changed the title [-]Grails 7: Console and Cli rewrite for org.jline:jline:3.0.0-3.27.1[/-] [+]Console and Cli rewrite for org.jline:jline:3.0.0-3.27.1+[/+] on Aug 5, 2025
  7. added this to the grails:8.0.0-M1 milestone on Aug 5, 2025
  8. added 3 commits that reference this issue on Jan 30, 2026
    958bfea
    5d68523
    57e5cbe
  9. added a commit that references this issue on Jan 31, 2026
    b4e78a0
  10. moved this from Todo to In Progress in Apache Grailson Feb 5, 2026
  11. self-assigned this
    on Feb 5, 2026
  12. moved this from In Progress to Todo in Apache Grailson Apr 26, 2026
  13. moved this from Todo to Done in Apache Grailson Apr 26, 2026
  14. closed this as completedby moving to Done in Apache Grailson Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions