JetBrains / java-annotations

Annotations for JVM-based languages.
Apache License 2.0
404 stars 47 forks source link

Change scope of artifact to "provided" #41

Closed JacksonBailey closed 3 years ago

JacksonBailey commented 3 years ago

The annotations are not needed at runtime. They only provide hints to the IDE about how the code works. The Gradle example uses compileOnly, using Maven's provided scope will perform the same thing. It causes the dependency to be made available during compilation but not at runtime. (The fact that it assumes it will be "provided" at runtime is irrelevant, it simply doesn't need to be provided.)

Note that using the provided scope is more correct than using <optional>true</optional> since making something optional only affects downstream projects that depend on your own. It will still be made available at runtime.

chashnikov commented 3 years ago

Merged, thank you for the contribution.