I want to add a dependency to a project solely for referencing them in Javadocs, like {@link some.class.from.dependency.Foo#bar()}
. What scope I should better use for such dependencies: optional
or provided
? Or I still need compile
?
Asked
Active
Viewed 354 times
2

leventov
- 14,760
- 11
- 69
- 98
1 Answers
0
I think the proper scope is provided
.

leventov
- 14,760
- 11
- 69
- 98
-
1Provided does ensure that this dependency is not bundled into the jar but at the same time if someone uses this for anything other than documentation it will cause a runtime exception. Original intention of provided is to add dependencies that would be "provided" by container or jdk so as to add this only during compilation and not during runtime. It would have been great if we had a doc scope similar to test scope – Jiss Janardhanan Dec 13 '18 at 00:22