As the title said that I just wonder if we have some way to use CDI injection or Spring in Ivy Project? FYI, I'm using Ivy Designer v6 s16. I did try to use CDI in my bean, it acknowledged the bean with @Named annotation; however, the service that I try to inject return null (throwing InvokeException & NullPointerException). Though I know that Ivy Engine not yet supported CDI injection, I just want to know if there is any trick to go around it? asked 30.09.2015 at 09:27 ToanLC |
As you said the Ivy Engine does not support CDI injection. If you try to setup and use Spring then I think you will get into troubles with incompatible jars and or versions. In Ivy internally we use Google Guice for DI. This allows us to use @Inject, @Named annotations. To get an instance of a root class you can use:
Note that this is not Public API and will be changed in future! If you want to use it I strongly suggest that you encapsulate the code in a project specific helper class, so that you only have to change the helper class once we change the internal API. answered 30.09.2015 at 16:14 Reto Weiss ♦♦ |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 30.09.2015 at 09:27
Seen: 1,889 times
Last updated: 30.09.2015 at 16:14