I have build.gradle in front of me and there are some dependencies declared as provided but in documentation I do not see this dependency scope.
dependencies {
    compile("org.springframework.boot:spring-boot-starter-web:1.2.4.RELEASE")
    ....
    provided 'backport-util-concurrent:backport-util-concurrent:3.1'
    provided 'org.javolution:javolution:5.5.1@jar
    ....
}
Is this provided by a plugin? If so how do I found out which plugin this belongs to?
What is the difference between provided and runtime dependency scope in Gradle?
                        
Suppose that a
jaris needed to compile your code, but the jar is present in the production environment library collection. Then you don't need to package the jar with your project archives. To support this requirement, Maven has a scope namedprovided. If you declare any jar dependency asprovided, then this jar will be present in your classpath during compilation but will not be packaged with your project archive.providedscope is very useful, particularly in web applications. For example,servlet-api.jaris needed to be present in your classpath to compile your project, but you don't need this to packageservlet-api.jarfile with yourwar. Withprovidedscope one can achieve this requirement.There is no Scope defined in Gradle
javaplugin namedprovided. Also not inwarorandroidplugins. If you want to useprovidedscope in your project, then you have to define it in yourbuild.gradlefile. Following is the code snippet to declareprovidedscope in gradle:Now, your second question:
To answer this question first I will define
compiledependency.compiledependencies are dependencies, those are necessary to compile your code. Now imagine that if your code uses a library namedXthen you must declareXas your compile-time dependency. Also imagine thatXuses another libraryYinternally, and you declaredYas your runtime dependency.During compilation, Gradle will add
Xinto your classpath but will not addY. Since,Yis not required for compilation. But it will package bothXandYwith your project archive since bothXandYare necessary to run your project archive in the production environment. Generally, all the dependencies needed in the production environment are known asruntimedependency.In Gradle official documentation, it says that
runtimedependency are "the dependencies required by the production classes at runtime. By default, also includes the compile time dependencies.".Now, if you've read this far, then you already know that
providedis acompiledependency that we don't want to be present in theruntimedependency (basically, we don't want it to package with the project archive).Following is an illustration of
providedandruntimescope. Here,compilerefers to the dependencies that are required to compile the project andnon-compilerefers to the dependencies that are not required for project compilation.