Skip to content

//RUNTIME_OPTIONS not honoured to try and set legacy resolver in Quarkus #2444

@holly-cummins

Description

@holly-cummins

I'm not entirely sure if this is a Quarkus issue or a JBang issue, so raising it here to start.

I'm finding that I can't use //RUNTIME_OPTIONS -Dquarkus.bootstrap.legacy-model-resolver=true to set the legacy runtime resolver in Quarkus. I don't know if other runtime options are also affected, or if it's something specific to when this is read and bootstrapped (the latter, I suspect).

To reproduce:

///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 17+
// Update the Quarkus version to what you want here or run jbang with
// `-Dquarkus.version=<version>` to override it.
//DEPS io.quarkus:quarkus-bom:${quarkus.version:999-SNAPSHOT}@pom
//DEPS io.quarkus:quarkus-rest:${quarkus.version:999-SNAPSHOT}

// This should work
//RUNTIME_OPTIONS -Dquarkus.bootstrap.legacy-model-resolver=true                                     
// This shouldn't work, I don't think, but I put it in to be sure
//Q:CONFIG quarkus.bootstrap.legacy-model-resolver=true

import jakarta.enterprise.context.Dependent;
import jakarta.inject.Inject;
import io.quarkus.runtime.annotations.QuarkusMain;
import io.quarkus.runtime.QuarkusApplication;

import java.util.List;
import java.util.Map;

import io.quarkus.runtime.Quarkus;

@QuarkusMain
public class repro implements QuarkusApplication {

    @Override
    public int run(String... args) throws Exception {
        System.out.println("Hello world.");

        return 0;
    }
}

This prints a java 25 warning, but you can see the problem before it gets to that point. You can see it's running with the new resolver because a log statement is printed when using the old resolver, or, to be absolutely sure, you can instrument ApplicationDependencyTreeResolver (old) and ApplicationDependencyResolver (new) with some printlns to show what's being run.

jbang -Dquarkus.bootstrap.legacy-model-resolver=true repro.java also runs with the new resolver, but I'd sort of expect that since that's why the //RUNTIME_OPTIONS option exists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions