1) Javadoc artifacts tend to take too much space and time to download.
For example, scala-library-2.10.2-sources.jar
is 1 Mb, but scala-library-2.10.2-javadoc.jar
is 34 Mb.
2) Javadoc is mostly not needed at all. As modern IDEs can fetch all info from sources.
So I wanted to find a way to alter sbt settings to completely disable javadoc download among third-party library dependencies.
Background. update resolves dependencies according to the settings in a build file, such as libraryDependencies and resolvers . Other tasks use the output of update (an UpdateReport ) to form various classpaths. Tasks that in turn use these classpaths, such as compile or run , thus indirectly depend on update .
unmanaged dependencies are jars dropped into the lib directory. managed dependencies are configured in the build definition and downloaded automatically from repositories.
SBT Dependencies SBT is the most usual build tool for Scala projects. As a project gets more complex, it will increase the number of dependencies. And each dependency brings other dependencies, called transitive dependencies. Eventually, a project can suffer from the JAR dependency hell.
sbt provides an interface to the repository types available in Ivy: file, URL, SSH, and SFTP. A key feature of repositories in Ivy is using patterns to configure repositories.
https://github.com/mpeltonen/sbt-idea/issues/225#issuecomment-19150022 kindly gives the answer:
The javadoc is typically much more bulky and less useful than the sources. I have at least turned off downloading javadocs by putting this setting in ~/.sbt/build.sbt:
transitiveClassifiers in Global := Seq(Artifact.SourceClassifier)
See also What is a classifier in SBT.
Note that ~/.sbt/build.sbt
on Linux corresponds to %USERPROFILE%\.sbt\build.sbt
on Windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With