I’m rather irritatingly getting this error in my maven builds at the moment, trying to setup some release builds using Go:
POM ' release:prepare release' not found in repository
One issue I have with Go is that it doesn’t natively support maven. This isn’t really much of a big deal because I can just tell it to run a custom command, and point it to the mvn shell or batch file (this could be a bit of a pain if I want my builds run on windows and/or linux but don’t want to have to define separate build jobs for each one, but I don’t, and I can’t think of any reason why I would, so that’s ok). Anyway, the issue this time is with the way I setup the build job. I used the new (in version 2.2) clicky-UI to setup the job, like telling it to run the mvn batch file, and what arguments to pass. This just seemed not to work. When I looked at the Go xml file it looked a bit like this:
<job name=”build_release”>
<tasks>
<exec command=”D:\buildTools\maven\2.2.1\bin\mvn.bat” workingdir=”yadda\yadda”>
<args>-B release:prepare release:perform</args>
</tasks>
<resources>
<resource>windows</resource>
</resources>
</job>
So I deleted it and manually edited the xml, making it look like this instead:
<job name=”build_release”>
<tasks>
<exec command=”D:\buildTools\maven\2.2.1\bin\mvn.bat” args=”-B release:prepare release:perform” workingdir=”yadda\yadda” />
</tasks>
<resources>
<resource>windows</resource>
</resources>
</job>
And this seems to have fixed it. Not very impressive at all.
I agree that Go needs to better handle arguments entered via the UI — either better inline help or intelligent argument parsing.
The problem is that the UI expects each argument to be in a separate line. If multiple arguments are placed in a single line, that entire string gets passed as a single argument to mvn. It’s similar to doing this:
$ mvn “-B release:prepare release:perform”
This makes mvn think that there is only one argument and it bombs.
However, when each argument is placed on a new line, you get the correct result:
$ mvn “-B” “release:prepare release:perform”
Now, this may not have been completely intuitive and perhaps Go should be doing a better job of either understanding the intent of the arguments, or better communicating to the user on how it expects arguments to be specified. Either way, appreciate the feedback; we’ll make it more intuitive.
Hi Anush!
Thanks for the comment – I’ll bear that in mind – it also makes sense now you’ve mentioned it 🙂
Also, I’ve thrown away the maven release plugin, on account of it being the work of satan.