Let me elaborate a bit just in case
project.parent.parent.version does not resolve at all during the dependency check phase
project.parent.version and project.version do, but they might not be sufficient for more complex projects (with 3+ levels).
You also cannot use project.parent.version and project.version in a variable as it does not resolve where the variable is declared - it is resolved in the project where it is used.