I have searched all over the net what's the difference between provided and compile scope in maven but everywhere the answer was during provided scope dependency is provided by JDK or a container at run time and not packaged in war and when scope is compile it is packaged in the war.
But no one tells about how this behaves during compilation, because if scope is 'compile' then ok , we know that same dependency which is present during compilation is packaged in war and same is used during run time, so no problem. But if dependency is provided then who provides it during compilation and whether it is same(version) with when provided by container.