I am wandering how you do guys debug maven?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

I am wandering how you do guys debug maven?

Simon Sheng
Hi,

I am bringing this baby question since Maven load all it's classes by
ClassWorlds. Which means it doesn't have "main method". instead we debug
everything by log, do we have other way like debug with any IDE: Eclipse,
Intellij etc. put breakpoints and debug step by step ?

Thanks

Simon(ChengHong) Sheng
Reply | Threaded
Open this post in threaded view
|

Re: I am wandering how you do guys debug maven?

Jeff MAURY-2
M2e takes care of everything

Jeff

Le lun. 8 oct. 2018 à 23:09, Simon Sheng <[hidden email]> a écrit :

> Hi,
>
> I am bringing this baby question since Maven load all it's classes by
> ClassWorlds. Which means it doesn't have "main method". instead we debug
> everything by log, do we have other way like debug with any IDE: Eclipse,
> Intellij etc. put breakpoints and debug step by step ?
>
> Thanks
>
> Simon(ChengHong) Sheng
>
Reply | Threaded
Open this post in threaded view
|

Re: I am wandering how you do guys debug maven?

Tibor Digana
In IntelliJ IDEA it is "Remote", see Select Run/Debug Configurations >
Remote, change the port to 8000.
Run command *mvnDebug test* and then start "Remote" in IDEA.

On Tue, Oct 9, 2018 at 6:16 AM Romain Manni-Bucau <[hidden email]>
wrote:

> Hello
>
> Not sure the question was about test classes - you got answers for that ;)
> - or maven and plugins themselves. If the last one, just replace "mvn" by
> "mvnDebug" in any command and remote debug on port 8000 in your IDE.
>
> Side note: if you check mvn script you will see maven has a main class so
> can be remote debugged as any java software ;)
>
> Le mar. 9 oct. 2018 05:44, Olivier Lamy <[hidden email]> a écrit :
>
> > an other option is to use command line and the surefire option:
> > -Dmaven.surefire.debug=true
> > then you can have debug on port 5005 (look at your ide to start a remote
> > debug)
> >
> > On Tue, 9 Oct 2018 at 08:45, Enrico Olivelli <[hidden email]>
> wrote:
> >
> > > Il lun 8 ott 2018, 23:23 Jeff MAURY <[hidden email]> ha scritto:
> > >
> > > > M2e takes care of everything
> > > >
> > >
> > > Same for Apache Netbeans :)
> > >
> > > Enrico
> > >
> > >
> > > > Jeff
> > > >
> > > > Le lun. 8 oct. 2018 à 23:09, Simon Sheng <[hidden email]> a
> > > écrit :
> > > >
> > > > > Hi,
> > > > >
> > > > > I am bringing this baby question since Maven load all it's classes
> by
> > > > > ClassWorlds. Which means it doesn't have "main method". instead we
> > > debug
> > > > > everything by log, do we have other way like debug with any IDE:
> > > Eclipse,
> > > > > Intellij etc. put breakpoints and debug step by step ?
> > > > >
> > > > > Thanks
> > > > >
> > > > > Simon(ChengHong) Sheng
> > > > >
> > > >
> > > --
> > >
> > >
> > > -- Enrico Olivelli
> > >
> >
> >
> > --
> > Olivier Lamy
> > http://twitter.com/olamy | http://linkedin.com/in/olamy
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: I am wandering how you do guys debug maven?

Simon Sheng
Hi John,

I am trying the profile, but no matter 5005 or 8000 port, I can't start
debug. Would you please give me more detail of this profile.

I global search maven source code, only classworld pom file has debug
profile.

I am looking into the wrapper you mentioned.

Thank you!

Simon(ChengHong) Sheng


On Tue, Oct 9, 2018 at 5:24 AM John Patrick <[hidden email]> wrote:

> others have talked about mvnDebug, i prefer using a profile e.g.
> debug, then all the surefire and failsafe and exec-maven-plugin, plus
> other plugins are all configured to use ${DEBUG_ARGS}, then;
>
> $ mvn -Pdebug test
> $ mvn -Pdebug exec:java
>
> Then in intellij/eclipse/netbeans I can just connect a remote debugger
> to the code. For some situations you want it to pause the execute
> until your debugger is connected otherwise you might miss breakpoints
> if those test are executed 1st.
>
> I've also switched to maven wrapper so don't have mvnDebug anymore as
> it means developers don't need to keep their local machines in sync
> and just do mvnw and it will sort out the maven version that
> project/branch requires.
>
>
> On Tue, 9 Oct 2018 at 06:29, Tibor Digana <[hidden email]> wrote:
> >
> > In IntelliJ IDEA it is "Remote", see Select Run/Debug Configurations >
> > Remote, change the port to 8000.
> > Run command *mvnDebug test* and then start "Remote" in IDEA.
> >
> > On Tue, Oct 9, 2018 at 6:16 AM Romain Manni-Bucau <[hidden email]
> >
> > wrote:
> >
> > > Hello
> > >
> > > Not sure the question was about test classes - you got answers for
> that ;)
> > > - or maven and plugins themselves. If the last one, just replace "mvn"
> by
> > > "mvnDebug" in any command and remote debug on port 8000 in your IDE.
> > >
> > > Side note: if you check mvn script you will see maven has a main class
> so
> > > can be remote debugged as any java software ;)
> > >
> > > Le mar. 9 oct. 2018 05:44, Olivier Lamy <[hidden email]> a écrit :
> > >
> > > > an other option is to use command line and the surefire option:
> > > > -Dmaven.surefire.debug=true
> > > > then you can have debug on port 5005 (look at your ide to start a
> remote
> > > > debug)
> > > >
> > > > On Tue, 9 Oct 2018 at 08:45, Enrico Olivelli <[hidden email]>
> > > wrote:
> > > >
> > > > > Il lun 8 ott 2018, 23:23 Jeff MAURY <[hidden email]> ha
> scritto:
> > > > >
> > > > > > M2e takes care of everything
> > > > > >
> > > > >
> > > > > Same for Apache Netbeans :)
> > > > >
> > > > > Enrico
> > > > >
> > > > >
> > > > > > Jeff
> > > > > >
> > > > > > Le lun. 8 oct. 2018 à 23:09, Simon Sheng <[hidden email]>
> a
> > > > > écrit :
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I am bringing this baby question since Maven load all it's
> classes
> > > by
> > > > > > > ClassWorlds. Which means it doesn't have "main method".
> instead we
> > > > > debug
> > > > > > > everything by log, do we have other way like debug with any
> IDE:
> > > > > Eclipse,
> > > > > > > Intellij etc. put breakpoints and debug step by step ?
> > > > > > >
> > > > > > > Thanks
> > > > > > >
> > > > > > > Simon(ChengHong) Sheng
> > > > > > >
> > > > > >
> > > > > --
> > > > >
> > > > >
> > > > > -- Enrico Olivelli
> > > > >
> > > >
> > > >
> > > > --
> > > > Olivier Lamy
> > > > http://twitter.com/olamy | http://linkedin.com/in/olamy
> > > >
> > >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>