Skip to content
⌘ NSIS Forum Archive

Maven2 error

8 posts

nickfox#

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
nickfox#
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#
Then, try to pass the abosolute path, for example:

ExecWait "$PROGRAMFILES\face2name\f2nserver\trunk\mvn 'install'"
nickfox#
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#
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