2 Replies Latest reply on Apr 11, 2019 9:32 AM by sabri-boubaker

    Jandex usage

    sabri-boubaker

      Hello Everyone,

       

      If I really understand what Jandex is used For: "Used as an annotation Index who creates Index which will be used by the WELD module"

       

      Is it right ? If so, I don't really understand why Jandex create an AnnotationInstance for every annotation in my classpath (homemade annotations, swagger, javax.rs , ...etc).

       

      This way my application has a bigger footprint.

       

      Is there any reason Jandex indexes every @ in my classpath (even my homemade ones) ? If not, is there any way to ignore my homemade @s without touching the Jandex source code ?

       

      Thanks in advance

       

      PS: Be gentle, this is my first question here !

        • 1. Re: Jandex usage
          manovotn

          Hello

           

          First of all, Jandex is a separate technology which doesn't need to be used by Weld depending in EE server and/or environment. It is used by default in WildFly and can be used in Weld SE, but I think other EE servers do no use it.

          The code and code docs around Jandex can be seen here.

           

          I am no Jandex expert myself, but what it creates (mkouba correct me if I am wrong ) is an index of all annotations that you can then easily browse/query for a complete information on a deployment without ever actually touching the java classes.

          That means without the need to load them among other things. So while there is some footprint, it should be rather miniature and save you resources on other fronts.

           

          As for how to configure it, I am pretty sure there has to be some way, but if you are talking WildFly, then it is WFLY that does Jandex building and Weld merely consumes the built index (which is another plus of Jandex, it is built once and many technologies consume it without the need to scan the deployment again). So this question would probably be a better fit for WFLY forums?

          1 of 1 people found this helpful
          • 2. Re: Jandex usage
            sabri-boubaker

            Hello and Thank you,

             

            I will close this question and post it under the WFLY forums.

             

            Sabri