I want to run mvn clean compile in each directory in my Eclipse workspace containing a pom.xml file.
I was able to run svn update for each directory containing .svn like this:
PS C:\workspace> Get-ChildItem -recurse -force |
where {$_.name -eq ".svn"} |
foreach {svn update $_.parent.FullName}
However, this gives the full path to svn and runs from the current directory. The mvn clean compile needs to be run inside the directory, afaik. Tried doing the following, but then I just get an error saying something can't be null. Seems to be the first cd call it complains about. Do I just have some syntax wrong, or am I using foreach wrong?
PS C:\workspace> Get-ChildItem -recurse |
where {$_.name -eq "pom.xml"} |
foreach { cd $_.parent.name; mvn clean compile; cd ..; }