Passing properties via the command line

If suppose I pass any property via command line and if there exist the same property in build.gradle file then would command-line property overrides the property value in build.gradle?

Yes, that is how it works. Properties on the command line override all others.

https://docs.gradle.org/current/userguide/build_environment.html

The configuration is applied in following order (if an option is configured in multiple locations the last one wins):

from gradle.properties in project build dir.
from gradle.properties in gradle user home.
from system properties, e.g. when -Dsome.property is set on the command line.