External annotations for JDK


I ported a few thousand lines of code to Kotlin as an experiment and during that I had to to add quite a few external annotations to various JDK-methods. That in itself was easy enough, but the problem is that while I could add the annotations to version control I couldn't get find a way to configure the annotations at the project level. Instead I had to add a custom JDK-configuration to IDEA, configure annotations for that and document in the README-file of my project how to setup this so that other developers get the annotations as well. Am I missing something or is this the best way to go?

Actually at first I didn’t even realize that the annotations are global: it was only when I started a second larger Kotlin-project that I noticed that it was placing its annotations in the source tree of the first project. So I guess that this is something that could really trip people over. The situation is quite ironic, since currently third-party libraries are actually easier to use with Kotlin than JDK.


Seems that there's already an issue IDEA-78559, which is related to this. While sharing external annotations between team members is something that I've wished I could do when writing Java, it's even more important in Kotlin because the code won't even compile without the annotations. Are there any plans to implement this?