Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Does anyone know how to make hudson parse the pom.xml for a maven project, then allow the user to add the goals to each sub module? I am trying to write a script that will automate adding this but I cant figure out a way how? Can this be done from the API?

share|improve this question

1 Answer 1

Here a step by step guide:

  • create your new maven job
  • run your job, so that it downloads the pom and knows about the modules
  • go to your job
  • click modules on the left
  • click on one of the modules
  • now click configure
  • you have a goial option here. according to the help text, it will overwrite the parent goal

Haven't tried it yet, but I will, since I need to implement a work around for my projects.

Let me know if it works.

share|improve this answer
Hi peter, thanks for the response. But I am trying to figure out a way to do this before it builds the project. I think groovy can do this but I am not very well suited to java to play around with it. –  Nerdatastic Nov 1 '10 at 16:23
Hudson does not have the build file before the first build, since the pom file(s) is/are still only in the repository and the workspace is empty. There might be a way around it. create a job and only configure the SCM. Start the job. It will download the source and Hudson should be able to parse the pom files. –  Peter Schuetze Nov 1 '10 at 16:32
Yea that works kind of. It would make it so I can get the modules, then what I could do is shutdown hudson and then add the goals from my file. –  Nerdatastic Nov 1 '10 at 19:28
So I think I have a plan, I can set them all to clean and then run them, then add in the goals and then reload hudson –  Nerdatastic Nov 1 '10 at 19:32
It might work even without building. Did you try to 'build' the job without having any build step configured? I would expect that you only need to configure the SVN path and don't even configure a schedule for polling from the SVN. I am not sure why you want to shutdown Hudson, just disable your new job after you have run it, if you want to be sure. But it won't run anyway, since you didn't configure a polling schedule. I have quite a few jobs that need to be triggered manually. –  Peter Schuetze Nov 2 '10 at 12:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.