Maven 2 & 3

Hide drive-relative paths from plugins

Details

  • Complexity:
    Intermediate
  • Number of attachments :
    1

Description

Take this nice path: /tmp (note the leading slash). This is an absolute path on Unix derivates but a drive-relative path on a Windows box. Drive-relative paths are resolved by prepending the drive of the current directory, not the entire current directory.

This notation of a drive-relative path is not well-known, even among Windows users, and in particular not easy going for cross-platform Java tools. A Java developer usually assumes that a path is either (directory-)relative or absolute.

To avoid unnecessary complications as seen on our own multi-OS CI grid (cf. dev@ thread CI Grid, Windows and Paths) and as reported by users (e.g. MECLIPSE-404), the core should not only align directory-relative paths but also resolve drive-relative paths.

Issue Links

Activity

Hide
Brett Porter added a comment -

does Java on Windows return false for isAbsolutePath() on these?

Show
Brett Porter added a comment - does Java on Windows return false for isAbsolutePath() on these?
Hide
Benjamin Bentmann added a comment -

Yeah, e.g. the commands

System.out.println( new File( "/tmp" ).isAbsolute() );
System.out.println( new File( "/tmp" ).getAbsolutePath() );

will print

false
D:\tmp

where "D:" is the drive of the current directory.

Show
Benjamin Bentmann added a comment - Yeah, e.g. the commands
System.out.println( new File( "/tmp" ).isAbsolute() );
System.out.println( new File( "/tmp" ).getAbsolutePath() );
will print
false
D:\tmp
where "D:" is the drive of the current directory.
Hide
Benjamin Bentmann added a comment -

Fixed in r739385 and r739394, respectively.

Show
Benjamin Bentmann added a comment - Fixed in r739385 and r739394, respectively.
Hide
Benjamin Bentmann added a comment -

Patch for 3.x to be applied once alpha-2 is out, the corresponding IT will remind me...

Show
Benjamin Bentmann added a comment - Patch for 3.x to be applied once alpha-2 is out, the corresponding IT will remind me...
Hide
Benjamin Bentmann added a comment -

Merged to 3.x in r739735.

Show
Benjamin Bentmann added a comment - Merged to 3.x in r739735.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: