-
Not sure whether this is an issue with picocli, or with micronaut-picocli; also see remkop/picocli#1444. Basically picocli fails to recognize any options defined in superclasses of command implementations or superclasses of argument groups, for example in the following two examples: public abstract class AbstractSomeBaseCommand implements Runnable {
@ArgGroup(heading = "Some arg group:%n", order = 1000)
@Getter private MyArgGroup argGroup;
private static class MyArgGroup {
// This option is not recognized by picocli for concrete command subclasses when running as native image
@Option(names = {"--someOption", "-s"}, required = false, defaultValue = "default")
@Getter private String someOption;
}
...
} @ArgGroup(heading = "My xyz options:%n", order = 1000)
@Getter private MyArgGroup argGroup;
// Any options defined in MyArgGroupNonAbstractBaseClass are not visible when running as native image
private static class MyArgGroup extends from MyArgGroupNonAbstractBaseClass {
@Option(names = {"--extra-option", "-e"}, required = false, defaultValue = "default")
@Getter private String extraOption;
} As suggested in remkop/picocli#1444 (comment), using the I also tried adding Anyone any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Looks like I've been able to fix this by adding |
Beta Was this translation helpful? Give feedback.
Looks like I've been able to fix this by adding
@ReflectiveAccess
annotations at class-level for all affected classes; see remkop/picocli#1444 for details. I think this is a bit cumbersome though, so any alternative solutions are welcome.