maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Max Andersen (JIRA)" <>
Subject [jira] Commented: (SUREFIRE-184) [PATCH] make the basedir system property optional
Date Wed, 22 Sep 2010 23:23:33 GMT


Max Andersen commented on SUREFIRE-184:

Just want to comment that I bumped into the exact same issue converting my ant based build
for hibernate tools into a maven one.

Part of the tests are to verify that the ant tasks in hiberante tools work and because of
this forced set of "basedir" it makes Ant behave differently/wrong when launched from within
surefire driven tests.

I don't know why "basedir" is being set but did find a "decent" workaround for configureProject(..)

 project.setProperty("basedir", antfile.getParentFile().getAbsolutePath()); 

Where antfile is the location of the build file you are testing.
That ensures that its consistent with when no basedir are set.

Downside is though that it also overrides any specific basedir set in the build.xml which
is a shame.

Anyway, just adding that for prosperity and here is my +1 to somehow isolate that "basedir"
property set by surefire so its not "leaking" into the actual tests.

> [PATCH] make the basedir system property optional
> -------------------------------------------------
>                 Key: SUREFIRE-184
>                 URL:
>             Project: Maven Surefire
>          Issue Type: Improvement
>         Environment: tested on Win2K with cygwin and JDK1.5, but this is indifferent.
>            Reporter: Antoine Levy-Lambert
>             Fix For: Backlog
>         Attachments: patch.txt
> I wanted to run the ant testcases using the maven-surefire-plugin (I actually built all
the ant jars using maven).
> The problem is that the plugin sets a system property basedir that ant cannot override.
Since the BuildFileTest s are heavily dependent upon this property that ant normally sets
to be the directory of the build file, most tests fail ...
> Here a patch adding the possibility not to set the basedir by setting a configuration
attribute omitbasedir to true. 
> The pom.xml of maven-surefile-plugin was also missing a dependency to surefire-api (or
at least I needed to add this to build properly).
> Regards,
> Antoine

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


View raw message