Provided dependency for third party libraries

Hi All, I am new to Gradle and build tools, I am facing an issue which need to make log4j2 libraries as provided. As I learnt so far, I understand that we can make libraries “provided” only if they are gettable from deployment environment. Standard example is servlet-api. Can someone assert my understanding ? If so, then can plugin solves this ?