I can probably get this into the mainline tonight unless someone objects.
Also, shouldn't it actually chdir()? I seem to recall some issues
with the old beta-4 version where some things didn't behave if
you tried to build at other than the project root.
>
> Am I the only one who misses ant's '-find' command line option? I realize I
> can use maven's '-d' option to specify the working directory, but this makes
> switching between projects/platforms pretty awkward. I'd rather just have
> it use the first maven.xml (project.xml?) it finds searching up the
> directory tree.
>
> It would be easy enough to add a find option, but because maven uses two
> config files (maven.xml and project.xml) instead of ant's one (build.xml),
> I'm not sure which one it should find.
>
> I was thinking maybe the App.initializeCore method could do something like
> this:
>
> if (getCli().hasOption("f"))
> {
> File file = find (getCli().getOptionValue("f"));
> getMaven().setProjectBuildFile (file);
> getMaven().setDir (file.getParent());
> }
> ....
> File find (String filename) throws FileNotFoundException
> {
> // An empty string should resolve to the current directory (user.dir)
> return find (new File (""), filename);
> }
>
> File find (File start, String suffix) throws FileNotFoundException
> {
> if (start == null) {
> throw new FileNotFoundException();
> }
> File dir = start.getAbsoluteFile();
> File file = new File(dir, suffix);
// Don't get infinite if no such file exists.
if (dir.equals(dir.getParentFile()) {
throw new FileNotFoundException(suffix);
}
> return file.exists() ? file : find (dir.getParentFile(), suffix);
> }
>
> Jim
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>