Where I can find @Inject jar

前端 未结 3 1661
情话喂你
情话喂你 2020-12-17 07:47

I\'m following the MVC unit test instructions from this site, but I cannot find the jar for the @Inject annotation. Does anybody know where the jar is?

3条回答
  •  我在风中等你
    2020-12-17 08:28

    Using javaee-api instead of javax.inject I ran into a bunch of issues.

    After some digging I found out that you need to add it with scope provided or otherwise it will add a Listener (com.sun.faces.config.ConfigureListener) at runtime.

    Another issue is that apparently the implementation to inject is different. Fields annotated with @inject remained null. By replacing the official sun jar with the javax.inject, this no longer happened.

    Note that i'm not an expert, I might be running into side-effects, but figuring this out took me such a long time, that I felt I had to share my findings so far.

提交回复
热议问题