Archive: Maven2 error


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


Did you try


ExecWait "mvn install"

yes, ExecWait "mvn install" was the first thing I tried.

Nick


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


Then, try to pass the abosolute path, for example:


ExecWait "$PROGRAMFILES\face2name\f2nserver\trunk\mvn 'install'"

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


I think I'm getting closer to the answer, mvn is a .bat file...

Nick


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