Expected Behavior
Dependency injection for parent class should work even if I don't provide a DI on the end class
Actual Behaviour
See this boilerplate
public class InjectCommand implements Runnable {
@Inject
private ApplicationContext applicationContext;
public void run() {
System.out.println("App Context: " + applicationContext);
}
}
with
@Command(name = "picocli-working", description = "...",
mixinStandardHelpOptions = true)
public class WorkingCommand extends InjectCommand {
@Inject
@Nullable
private ObjectMapper mapper;
public static void main(String[] args) throws Exception {
PicocliRunner.run(WorkingCommand.class, args);
}
}
the dependency injection is properly propagated to the parent class and it works

With that (notice I removed the dependency injection from the end class) it won't work and I get a null injection
@Command(name = "picocli-not-working", description = "...",
mixinStandardHelpOptions = true)
public class NotWorkingCommand extends InjectCommand {
public static void main(String[] args) throws Exception {
PicocliRunner.run(NotWorkingCommand.class, args);
}
}

Also, if any fix, would it be possible to backport it on 3.X.X ? Thanks !
Steps To Reproduce
No response
Environment Information
No response
Example Application
https://github.com/brian-mulier-p/micronaut-picocli-di-issue
Version
PICO CLI: 5.0.1, Micronaut: 4.0.3
Expected Behavior
Dependency injection for parent class should work even if I don't provide a DI on the end class
Actual Behaviour
See this boilerplate
with
the dependency injection is properly propagated to the parent class and it works

With that (notice I removed the dependency injection from the end class) it won't work and I get a null injection
Also, if any fix, would it be possible to backport it on 3.X.X ? Thanks !
Steps To Reproduce
No response
Environment Information
No response
Example Application
https://github.com/brian-mulier-p/micronaut-picocli-di-issue
Version
PICO CLI: 5.0.1, Micronaut: 4.0.3