maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gili (JIRA)" <>
Subject [jira] (MNG-4713) ${basedir} variable makes portable builds overly difficult
Date Sat, 13 Jul 2013 05:24:05 GMT


Gili commented on MNG-4713:


It's been a while but based on memory...

# Anyone who depends on the current value returned by ${basedir} will inevitably get a broken
build either on Windows or Unix. Breaking a build script that is already broken is not a problem
in my opinion.
# Try the following:


Now try invoking "java -Djava.library.path=${java.library.path}" from Maven. The build will
fail under Windows or Unix depending on what slash style you used in the property declaration
versus what slash style the current platform uses. Jochen provided some good examples in MNG-3198
describing how mixing the two different slash styles leads to runtime failures.
> ${basedir} variable makes portable builds overly difficult
> ----------------------------------------------------------
>                 Key: MNG-4713
>                 URL:
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Design, Patterns & Best Practices
>    Affects Versions: 2.2.1
>            Reporter: Gili
>             Fix For: Issues to be reviewed for 3.x
> Please reopen MNG-3198. I believe that Brett misunderstood what Jochen wrote. There is
no simple workaround with the current Maven implementation. Jochen was saying that Maven should
use unix-style slashes under Windows for the sake of portability and let users convert to
Windows-style slashes themselves if they wish to use an external script.
> Simple use-case: try passing a $\{basedir\}-relative path into the "java.library.path"
property. It's impossible to do this portably under Maven's existing implementation.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message