protected String getProjectRelativePath ( File file ) { String path = file . getAbsolutePath ( ) ; String prefix = project . getBasedir ( ) . getAbsolutePath ( ) ; if ( path . startsWith ( prefix ) ) { path = path . substring ( prefix . length ( ) + 1 ) ; } if ( File . separatorChar != ' ' ) { path = path . replace ( File . separatorChar , ' ' ) ; } return path ; }
Returns the path of given file relative to the enclosing Maven project .