Jonas N
Jonas N

Reputation: 1777

Debug Maven plugin under Eclipse

I'd like to debug a Maven plugin under Eclipse. I figure I could put it as a dependency; then write some java class that imports the plugin (somehow), and run it as an execution of the maven 'exec' plugin, the 'java' goal? Would this be doable or 'too hard'?

(Btw, use case: it's the hibernate3 plugin I can't get to generate the sql. Can get it to generate xml like 'Level.hbm.xml', though. I'm out of ideas. I might create a question of its own.)

(EDIT: proper headline, added tag.)

-EDIT2-

I see now that I may not have explained exactly what I wanted: I want to debug the plugin as it runs in the project where it is used. I'd like it to find its parameters/configuration from the pom.xml when I start debugging, if possible.

Upvotes: 4

Views: 2762

Answers (1)

nwinkler
nwinkler

Reputation: 54457

If you use the m2e Eclipse plugin, you can do the following:

  • Download and open other Maven projects, e.g. the Hibernate plugin (File > Import > Maven > Materialize Maven Projects from SCM)
  • Run and debug them locally

Please see https://docs.sonatype.org/display/M2ECLIPSE/Developing+and+debugging+Maven+plugins for an example.

Upvotes: 1

Related Questions