-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
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
No easy way to load stubs as Maven dependencies #6813
Comments
@obfischer I don't know of a better way to achieve your goal. I agree this is an annoyance. A feature we could add would be to parse additional stub files from jars in the processor path, loading them via a service loader. See, e.g., how NullAway loads stubx files: https://github.com/uber/NullAway/blob/ccc7f82e09f2a0f6e6149d97aa6a1ab824608030/nullaway/src/main/java/com/uber/nullaway/handlers/StubxCacheUtil.java#L90-L93 The Checker Framework code for parsing stub files is here. I don't think it would be too hard to enhance it with this functionality, if someone wants to put up a PR. |
Possible dup: #4058 |
I was also thinking of implementing this feature at some point, since this would be a big help to me. @obfischer FWIW, I've been using dependency:properties as a workaround. The setup is roughly
That setup is better than using hardcoded paths, but it also feels extremely clunky and has some sharp edges. It would be much cleaner to just add the stubs module to the |
I am using the Checkerframework in a Maven multi-modules project. For an external dependency I had to create a stubs file. The stubs file is part of a jar, which I create in a dedicated Maven module, so that I can reuse it.
According to the documentation and my searches on the Internet, the only way to use it is via
-Astubs=...
.All examples I have seen use a full qualified path (
-Astubs=/some/dir/my.jar
). For a Maven project, serveral persons contribute too, each one using his own directory structure, it is impossible to rely on a hard coded path.So, it would be very helpful and would make it much easier use custom, project specific stub files, it it would be possible to put them simply in a jar and add it to the classpath, so that it is available during compilation.
Currently I use the following workaround currently to my jar as Maven artifact:
Or is there a better way to achive my goal?
The text was updated successfully, but these errors were encountered: