[NEXUS-7815] improve handling of relative paths

Improve handling of relative paths.

https://issues.sonatype.org/browse/NEXUS-7815