You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Brett Porter (JIRA)" <ji...@codehaus.org> on 2007/01/21 23:29:23 UTC

[jira] Moved: (SUREFIRE-219) Tests Using Relative Paths Fail From Parent - Absolute Paths are Non-portable

     [ http://jira.codehaus.org/browse/SUREFIRE-219?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter moved MSUREFIRE-2 to SUREFIRE-219:
-----------------------------------------------

    Complexity:   (was: Intermediate)
           Key: SUREFIRE-219  (was: MSUREFIRE-2)
       Project: Maven Surefire  (was: Maven 2.x Surefire Plugin)

> Tests Using Relative Paths Fail From Parent - Absolute Paths are Non-portable
> -----------------------------------------------------------------------------
>
>                 Key: SUREFIRE-219
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-219
>             Project: Maven Surefire
>          Issue Type: Bug
>         Environment: Code base and repository on Unix. Build from Windows and Unix.
>            Reporter: Mike Whittemore
>         Assigned To: Brett Porter
>
> Tests in a child project fail to find files via relative path if they are run from a parent project, as the "basedir" of the child evaluates to the project where "mvn test" is run from. For example, a child project with a "test-data" directory in its base dir might have a unit test that loads a data file: new File("test-data/data1.xml"). Running "mvn test" from that child project's basedir works fine. If "mvn test" is run from the parent directory (which has no test-data directory in this example), the child project's test cannot find the file. This was not a problem with Maven 1. According to closed issue MNG-1570, this will not be fixed. One workaround is to use an aboslute path in the test file. Unfortunately, this instantly makes it non-portable, i.e. the test cannot be run from both windows and unix (as we routinely do on my software project). There are ugly workarounds available to the test develoeprs, but I request the Maven 1 behavior be added to Maven 2 so they are not necessary.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira