Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing the Maven Debug Flag from Hudson

Tags:

maven-2

hudson

I'm having an issue with a maven build in hudson. This issue would be fairly easy to resolve if I could see the output of maven with the -X flag passed in. However I can't find a way to do this. If I specify "-X" in the "Goals and options" field of the "Build" section in the job configuration my console output looks exactly the same as if I had not passed the "-X" flag at all. Is the debug logging going somewhere else? Or is there some other way I need to pass the "-X" flag?

UPDATE:

The reason this isn't working is because the build is failing during the "Parsing POMs" part of the hudson process, before it actually kicks off the true maven build and passes in any params I specify in the project. So what I really need is a way to get better logging during the "Parsing POMs" part of a maven build in hudson.

like image 465
kalak451 Avatar asked Oct 08 '10 15:10

kalak451


People also ask

Can we debug in Maven?

You can use the maven. surefire. debug property to debug your forked tests remotely, like this: mvn -Dmaven.

What is mvnDebug?

mvnDebug - Command to start the Maven system in Debug mode.


2 Answers

That's what it says in the help text.

Specifies the goals to execute, such as "clean install" or "deploy". This field can also accept any other command line options to Maven, such as "-e" or "-Dmaven.test.skip=true".

I would have put it there as well.

The maven help gives me the following two options:

 -X,--debug                    Produce execution debug output
 -e,--errors                   Produce execution error messages

May be you can try the --debug or the -e swtich

like image 110
Peter Schuetze Avatar answered Nov 16 '22 02:11

Peter Schuetze


In Jenkins, and I assume this is true for Hudson as well, command line arguments can be passed to Maven in the "goals" setting. I was able to pass the -X parameter by adding it to the beginning of the "goals".

-X package install

Jenkins apparently blindly appends this setting to the end of the mvn command-line.

like image 33
Andrew Weaver Avatar answered Nov 16 '22 00:11

Andrew Weaver