We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependency injection for parent class should work even if I don't provide a DI on the end class
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 !
No response
https://github.com/brian-mulier-p/micronaut-picocli-di-issue
PICO CLI: 5.0.1, Micronaut: 4.0.3
The text was updated successfully, but these errors were encountered:
any idea why this is happening @dstepanov ?
Sorry, something went wrong.
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: