nickfox
7th January 2010 18:55 UTC
Maven2 error
I am trying to execute maven2 and I'm getting an error. Here is the code that I'm using:
SetOutPath "$INSTDIR\f2nserver\trunk"
ExecWait '"mvn" install'
the pom.xml file is in the trunk directory so I used SetOutPath to change the working directory. I also tried with out the quotes around mvn. Here is the error I am getting:
CreateDirectory: "C:\Program Files\face2name\f2nserver\trunk" (1)
Exec: command=""mvn" install"
Exec: failed createprocess (""mvn" install")
thanks for your help
Nick
Joel
7th January 2010 19:30 UTC
Did you try
ExecWait "mvn install"
nickfox
8th January 2010 00:32 UTC
yes, ExecWait "mvn install" was the first thing I tried.
Nick
nickfox
8th January 2010 01:01 UTC
I probably should have added that if I open a cmd shell and cd to C:\Program Files\face2name\f2nserver\trunk and run "mvn install", it runs fine.
Nick
Joel
8th January 2010 02:26 UTC
Then, try to pass the abosolute path, for example:
ExecWait "$PROGRAMFILES\face2name\f2nserver\trunk\mvn 'install'"
nickfox
8th January 2010 03:40 UTC
This is so strange. I tried that and got the same error. I decided to simplify things and call maven directly from it's bin dir without any switches:
SetOutPath $PROGRAMFILES\apache-maven-2.2.1\bin
ExecWait "$PROGRAMFILES\apache-maven-2.2.1\bin\mvn"
and still get the following error:
CreateDirectory: "C:\Program Files\apache-maven-2.2.1\bin" (1)
Exec: command="C:\Program Files\apache-maven-2.2.1\bin\mvn"
Exec: failed createprocess ("C:\Program Files\apache-maven-2.2.1\bin\mvn")
Nick
nickfox
8th January 2010 04:34 UTC
I think I'm getting closer to the answer, mvn is a .bat file...
Nick
nickfox
11th January 2010 17:12 UTC
You will never believe the solution to this problem. It took me hours to figure it out...
SetOutPath "$PROGRAMFILES\face2name\f2nserver\trunk"
ExecWait "mvn.bat install"
I had to add the .bat extension to mvn and then it worked without a problem...
Nick