You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andrew Pennebaker <ap...@42six.com> on 2013/10/10 16:38:18 UTC

Is there a Maven plugin for the Java debugger (jdb)?

I'd like to run jdb over some of my classes in a Maven project. Is there a
plugin I can drop into my pom.xml?

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Mark Derricutt <ma...@talios.com>.
You could run it via the maven-exec-plugin, which allows you to pass down the classpath.

On 11 Oct 2013, at 3:52, Andrew Pennebaker wrote:

> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts a jdb
> session on <Class>.main().
>
> I can run jdb on individual Java code outside of a Maven structure, but I'm
> not sure how to inform jdb of Java code in a Maven project, Maven's
> CLASSPATH handling, etc. etc.

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Andrew Pennebaker <ap...@42six.com>.
Thanks! I'll look into it!


On Thu, Oct 10, 2013 at 12:02 PM, Curtis Rueden <ct...@wisc.edu> wrote:

> Hi Andrew,
>
> Another option is to use the exec-maven-plugin to launch your java program
> of choice, then attach to it with jdb afterward using the "-attach" option.
>
> See also:
> http://stackoverflow.com/questions/2935375/debugging-in-maven
>
> Regards,
> Curtis
>
>
> On Thu, Oct 10, 2013 at 10:21 AM, Russell Gold <ru...@gold-family.us>
> wrote:
>
> > The simplest way to do this is actually to run it in your IDE directly.
> > IntellijIDEA community edition can import your maven project and thus get
> > all of the dependencies. Then you just run the program in the debugger. I
> > presume Eclipse can do something similar.
> >
> > On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker <ap...@42six.com>
> > wrote:
> >
> > > Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts a
> > jdb
> > > session on <Class>.main().
> > >
> > > I can run jdb on individual Java code outside of a Maven structure, but
> > I'm
> > > not sure how to inform jdb of Java code in a Maven project, Maven's
> > > CLASSPATH handling, etc. etc.
> > >
> > >
> > > On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > bimargulies@gmail.com>wrote:
> > >
> > >> What would that mean? Do you want to execute the program in the
> > debugger?
> > >>
> > >> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> > >> <ap...@42six.com> wrote:
> > >>> I'd like to run jdb over some of my classes in a Maven project. Is
> > there
> > >> a
> > >>> plugin I can drop into my pom.xml?
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> >
> > -----------------
> > Author, Getting Started with Apache Maven <
> > http://www.packtpub.com/getting-started-with-apache-maven/video>
> >
> > Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> > and listen to the Misfile radio play <
> > http://www.fuzzyfacetheater.com/misfile/>!
> >
> >
> >
> >
> >
> >
> >
> >
>

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Andrew,

Another option is to use the exec-maven-plugin to launch your java program
of choice, then attach to it with jdb afterward using the "-attach" option.

See also:
http://stackoverflow.com/questions/2935375/debugging-in-maven

Regards,
Curtis


On Thu, Oct 10, 2013 at 10:21 AM, Russell Gold <ru...@gold-family.us> wrote:

> The simplest way to do this is actually to run it in your IDE directly.
> IntellijIDEA community edition can import your maven project and thus get
> all of the dependencies. Then you just run the program in the debugger. I
> presume Eclipse can do something similar.
>
> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker <ap...@42six.com>
> wrote:
>
> > Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts a
> jdb
> > session on <Class>.main().
> >
> > I can run jdb on individual Java code outside of a Maven structure, but
> I'm
> > not sure how to inform jdb of Java code in a Maven project, Maven's
> > CLASSPATH handling, etc. etc.
> >
> >
> > On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> bimargulies@gmail.com>wrote:
> >
> >> What would that mean? Do you want to execute the program in the
> debugger?
> >>
> >> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> >> <ap...@42six.com> wrote:
> >>> I'd like to run jdb over some of my classes in a Maven project. Is
> there
> >> a
> >>> plugin I can drop into my pom.xml?
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
>
> -----------------
> Author, Getting Started with Apache Maven <
> http://www.packtpub.com/getting-started-with-apache-maven/video>
>
> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> and listen to the Misfile radio play <
> http://www.fuzzyfacetheater.com/misfile/>!
>
>
>
>
>
>
>
>

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Nambi,

> Debugging is one of the important features that is easy to do in IDE,
> but hard to do in CLI using jdb. If there is a way (plugin) that can
> enable this for emacs or vim, would be a great.

For Eclipse (my preferred tool): http://eclim.org/

I know people who use it to good effect, but personally I don't use it. I
prefer the opposite approach: embedding vim editing style into Eclipse:
http://vrapper.sourceforge.net/home/

Vim and Eclipse both bring so much productivity I would hate to give up
either of them. Fortunately, you don't have to. :-)

Regards,
Curtis


On Fri, Oct 11, 2013 at 12:19 PM, Sankaran, Nambi <ns...@ebay.com>wrote:

> A lot of developers are asking for simplicity of java development.
> Especially folks who code in other languages such as python, view java as
> heavy weight because of IDEs.
> It takes a while to master IDEs, without IDEs java is not a productive
> environment.
>
> I used to do Java development using CLI, but after I got used to IDEs
> development was a lot easier.
> IDEs do bring a lot of value .
> So, why not bring the nice features of IDEs into editors such as emacs or
> vim.
>
> Debugging is one of the important features that is easy to do in IDE, but
> hard to do in CLI using jdb.
> If there is a way (plugin) that can enable this for emacs or vim, would be
> a great.
>
>
> -----Original Message-----
> From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com]
> Sent: Friday, October 11, 2013 9:58 AM
> To: Maven Users List
> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
>
> Why would you want to walk from New York to San Francisco when you can fly?
>
> Some people are gluttons for punishment, some people like text-mode (works
> better over plain ssh without resorting to eg X11 forwarding)
>
> Finally debugging when the debugger and debugged process are on the same
> machine rather than separated by a 150ms latency link is a lot nicer... And
> sadly cli tools are the only way to handle that without adding significant
> lag.
>
> Having said all that, debuggers are the tool of last resort, if you need
> to use them you start worrying about heisenbugs etc.
>
> A good log file beats the pants off a debugger 99 times out of 100... Ask
> anyone who tried to figure out why the conference call talker indicators
> were invalid or did work on any real time system and they will swear by a
> good log file with mapped diagnostic context support.
>
> Me... I worked on real time conferencing systems, so a good log file is
> what I favour, you can't single step debug a real time teleconference ;-)
> the skills you learn trying figure out techniques to debug such systems are
> very valuable
>
> On Friday, 11 October 2013, Russell Gold wrote:
>
> > I'm sorry; I don't understand. Why would you want to use a text
> > editor, rather than an IDE,  to debug a java program?
> >
> > On Oct 11, 2013, at 11:52 AM, Andrew Pennebaker
> > <ap...@42six.com>
> > wrote:
> >
> > > Why would anyone want to do this? So we don't have to debug Maven
> > projects
> > > with Eclipse/IntelliJ, but the text editor of our choice. This is
> > > best accomplished by Maven tasks which interact with the command
> > > line jdb
> > tool.
> > >
> > >
> > > On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <ru...@gold-family.us>
> > wrote:
> > >
> > >> Why do you want to do that? I suspect we are not getting at your
> > >> actual requirement.
> > >>
> > >> On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker
> > >> <ap...@42six.com>
> > >> wrote:
> > >>
> > >>> Yes, various Java IDEs can debug Java code, including Java code
> > organized
> > >>> in Maven projects. What I'm interested in is debugging Java code
> > >>> in a
> > >> Maven
> > >>> project with an arbitrary text editor, not necessarily Eclipse or
> > >> Intellij,
> > >>> for example Emacs, or even Notepad, by invoking Maven tasks that
> > >>> point
> > to
> > >>> Maven plugins that interact with jdb.
> > >>>
> > >>>
> > >>> On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi
> > >>> <ns...@ebay.com>
> > >> wrote:
> > >>>
> > >>>> It very is easy to debug maven from eclipse, I have documented
> > >>>> how I
> > >> debug
> > >>>> maven-jetty-plugin using eclipse
> > >>>>
> > >>>>
> > >>
> > http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-wit
> > h-maven/
> > >>>>
> > >>>> -----Original Message-----
> > >>>> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> > >>>> Sent: Thursday, October 10, 2013 11:04 AM
> > >>>> To: Maven Users List
> > >>>> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
> > >>>>
> > >>>> I could also use an IDE for package management, but I'd rather
> > >>>> use
> > plain
> > >>>> Maven and an arbitrary text editor instead.
> > >>>>
> > >>>>
> > >>>> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold
> > >>>> <ru...@gold-family.us>
> > >>>> wrote:
> > >>>>
> > >>>>> The simplest way to do this is actually to run it in your IDE
> > directly.
> > >>>>> IntellijIDEA community edition can import your maven project and
> > >>>>> thus get all of the dependencies. Then you just run the program
> > >>>>> in the debugger. I presume Eclipse can do something similar.
> > >>>>>
> > >>>>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> > >>>>> <ap...@42six.com>
> > >>>>> wrote:
> > >>>>>
> > >>>>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that
> > >>>>>> starts a
> > >>>>> jdb
> > >>>>>> session on <Class>.main().
> > >>>>>>
> > >>>>>> I can run jdb on individual Java code outside of a Maven
> > >>>>>> structure, but
> > >>>>> I'm
> > >>>>>> not sure how to inform jdb of Java code in a Maven project,
> > >>>>>> Maven's CLASSPATH handling, etc. etc.
> > >>>>>>
> > >>>>>>
> > >>>>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > >>>>> bimargulies@gmail.com>wrote:
> > >>>>>>
> > >>>>>>> What would that mean? Do you want to execute the program in
> > >>>>>>> the
> > >>>>> debugger?
> > >>>>>>>
> > >>>>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> > >>>>>>> <ap...@42six.com> wrote:
> > >>>>>>>> I'd like to run jdb over some of my classes in a Maven
> > >>>>>>>> project. Is
> >
>
>
> --
> Sent from my phone
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Is there a Maven plugin for the Java debugger (jdb)?

Posted by "Sankaran, Nambi" <ns...@ebay.com>.
A lot of developers are asking for simplicity of java development.
Especially folks who code in other languages such as python, view java as heavy weight because of IDEs.
It takes a while to master IDEs, without IDEs java is not a productive environment.

I used to do Java development using CLI, but after I got used to IDEs development was a lot easier.
IDEs do bring a lot of value .
So, why not bring the nice features of IDEs into editors such as emacs or vim.

Debugging is one of the important features that is easy to do in IDE, but hard to do in CLI using jdb.
If there is a way (plugin) that can enable this for emacs or vim, would be a great.


-----Original Message-----
From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com] 
Sent: Friday, October 11, 2013 9:58 AM
To: Maven Users List
Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?

Why would you want to walk from New York to San Francisco when you can fly?

Some people are gluttons for punishment, some people like text-mode (works better over plain ssh without resorting to eg X11 forwarding)

Finally debugging when the debugger and debugged process are on the same machine rather than separated by a 150ms latency link is a lot nicer... And sadly cli tools are the only way to handle that without adding significant lag.

Having said all that, debuggers are the tool of last resort, if you need to use them you start worrying about heisenbugs etc.

A good log file beats the pants off a debugger 99 times out of 100... Ask anyone who tried to figure out why the conference call talker indicators were invalid or did work on any real time system and they will swear by a good log file with mapped diagnostic context support.

Me... I worked on real time conferencing systems, so a good log file is what I favour, you can't single step debug a real time teleconference ;-) the skills you learn trying figure out techniques to debug such systems are very valuable

On Friday, 11 October 2013, Russell Gold wrote:

> I'm sorry; I don't understand. Why would you want to use a text 
> editor, rather than an IDE,  to debug a java program?
>
> On Oct 11, 2013, at 11:52 AM, Andrew Pennebaker 
> <ap...@42six.com>
> wrote:
>
> > Why would anyone want to do this? So we don't have to debug Maven
> projects
> > with Eclipse/IntelliJ, but the text editor of our choice. This is 
> > best accomplished by Maven tasks which interact with the command 
> > line jdb
> tool.
> >
> >
> > On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <ru...@gold-family.us>
> wrote:
> >
> >> Why do you want to do that? I suspect we are not getting at your 
> >> actual requirement.
> >>
> >> On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker 
> >> <ap...@42six.com>
> >> wrote:
> >>
> >>> Yes, various Java IDEs can debug Java code, including Java code
> organized
> >>> in Maven projects. What I'm interested in is debugging Java code 
> >>> in a
> >> Maven
> >>> project with an arbitrary text editor, not necessarily Eclipse or
> >> Intellij,
> >>> for example Emacs, or even Notepad, by invoking Maven tasks that 
> >>> point
> to
> >>> Maven plugins that interact with jdb.
> >>>
> >>>
> >>> On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi 
> >>> <ns...@ebay.com>
> >> wrote:
> >>>
> >>>> It very is easy to debug maven from eclipse, I have documented 
> >>>> how I
> >> debug
> >>>> maven-jetty-plugin using eclipse
> >>>>
> >>>>
> >>
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-wit
> h-maven/
> >>>>
> >>>> -----Original Message-----
> >>>> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> >>>> Sent: Thursday, October 10, 2013 11:04 AM
> >>>> To: Maven Users List
> >>>> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
> >>>>
> >>>> I could also use an IDE for package management, but I'd rather 
> >>>> use
> plain
> >>>> Maven and an arbitrary text editor instead.
> >>>>
> >>>>
> >>>> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold 
> >>>> <ru...@gold-family.us>
> >>>> wrote:
> >>>>
> >>>>> The simplest way to do this is actually to run it in your IDE
> directly.
> >>>>> IntellijIDEA community edition can import your maven project and 
> >>>>> thus get all of the dependencies. Then you just run the program 
> >>>>> in the debugger. I presume Eclipse can do something similar.
> >>>>>
> >>>>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker 
> >>>>> <ap...@42six.com>
> >>>>> wrote:
> >>>>>
> >>>>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that 
> >>>>>> starts a
> >>>>> jdb
> >>>>>> session on <Class>.main().
> >>>>>>
> >>>>>> I can run jdb on individual Java code outside of a Maven 
> >>>>>> structure, but
> >>>>> I'm
> >>>>>> not sure how to inform jdb of Java code in a Maven project, 
> >>>>>> Maven's CLASSPATH handling, etc. etc.
> >>>>>>
> >>>>>>
> >>>>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> >>>>> bimargulies@gmail.com>wrote:
> >>>>>>
> >>>>>>> What would that mean? Do you want to execute the program in 
> >>>>>>> the
> >>>>> debugger?
> >>>>>>>
> >>>>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker 
> >>>>>>> <ap...@42six.com> wrote:
> >>>>>>>> I'd like to run jdb over some of my classes in a Maven 
> >>>>>>>> project. Is
>


--
Sent from my phone

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Stephen Connolly <st...@gmail.com>.
Why would you want to walk from New York to San Francisco when you can fly?

Some people are gluttons for punishment, some people like text-mode (works
better over plain ssh without resorting to eg X11 forwarding)

Finally debugging when the debugger and debugged process are on the same
machine rather than separated by a 150ms latency link is a lot nicer... And
sadly cli tools are the only way to handle that without adding significant
lag.

Having said all that, debuggers are the tool of last resort, if you need to
use them you start worrying about heisenbugs etc.

A good log file beats the pants off a debugger 99 times out of 100... Ask
anyone who tried to figure out why the conference call talker indicators
were invalid or did work on any real time system and they will swear by a
good log file with mapped diagnostic context support.

Me... I worked on real time conferencing systems, so a good log file is
what I favour, you can't single step debug a real time teleconference ;-)
the skills you learn trying figure out techniques to debug such systems are
very valuable

On Friday, 11 October 2013, Russell Gold wrote:

> I'm sorry; I don't understand. Why would you want to use a text editor,
> rather than an IDE,  to debug a java program?
>
> On Oct 11, 2013, at 11:52 AM, Andrew Pennebaker <ap...@42six.com>
> wrote:
>
> > Why would anyone want to do this? So we don't have to debug Maven
> projects
> > with Eclipse/IntelliJ, but the text editor of our choice. This is best
> > accomplished by Maven tasks which interact with the command line jdb
> tool.
> >
> >
> > On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <ru...@gold-family.us>
> wrote:
> >
> >> Why do you want to do that? I suspect we are not getting at your actual
> >> requirement.
> >>
> >> On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <ap...@42six.com>
> >> wrote:
> >>
> >>> Yes, various Java IDEs can debug Java code, including Java code
> organized
> >>> in Maven projects. What I'm interested in is debugging Java code in a
> >> Maven
> >>> project with an arbitrary text editor, not necessarily Eclipse or
> >> Intellij,
> >>> for example Emacs, or even Notepad, by invoking Maven tasks that point
> to
> >>> Maven plugins that interact with jdb.
> >>>
> >>>
> >>> On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <ns...@ebay.com>
> >> wrote:
> >>>
> >>>> It very is easy to debug maven from eclipse, I have documented how I
> >> debug
> >>>> maven-jetty-plugin using eclipse
> >>>>
> >>>>
> >>
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
> >>>>
> >>>> -----Original Message-----
> >>>> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> >>>> Sent: Thursday, October 10, 2013 11:04 AM
> >>>> To: Maven Users List
> >>>> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
> >>>>
> >>>> I could also use an IDE for package management, but I'd rather use
> plain
> >>>> Maven and an arbitrary text editor instead.
> >>>>
> >>>>
> >>>> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <ru...@gold-family.us>
> >>>> wrote:
> >>>>
> >>>>> The simplest way to do this is actually to run it in your IDE
> directly.
> >>>>> IntellijIDEA community edition can import your maven project and thus
> >>>>> get all of the dependencies. Then you just run the program in the
> >>>>> debugger. I presume Eclipse can do something similar.
> >>>>>
> >>>>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> >>>>> <ap...@42six.com>
> >>>>> wrote:
> >>>>>
> >>>>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts
> >>>>>> a
> >>>>> jdb
> >>>>>> session on <Class>.main().
> >>>>>>
> >>>>>> I can run jdb on individual Java code outside of a Maven structure,
> >>>>>> but
> >>>>> I'm
> >>>>>> not sure how to inform jdb of Java code in a Maven project, Maven's
> >>>>>> CLASSPATH handling, etc. etc.
> >>>>>>
> >>>>>>
> >>>>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> >>>>> bimargulies@gmail.com>wrote:
> >>>>>>
> >>>>>>> What would that mean? Do you want to execute the program in the
> >>>>> debugger?
> >>>>>>>
> >>>>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> >>>>>>> <ap...@42six.com> wrote:
> >>>>>>>> I'd like to run jdb over some of my classes in a Maven project. Is
>


-- 
Sent from my phone

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Russell Gold <ru...@gold-family.us>.
I'm sorry; I don't understand. Why would you want to use a text editor, rather than an IDE,  to debug a java program?

On Oct 11, 2013, at 11:52 AM, Andrew Pennebaker <ap...@42six.com> wrote:

> Why would anyone want to do this? So we don't have to debug Maven projects
> with Eclipse/IntelliJ, but the text editor of our choice. This is best
> accomplished by Maven tasks which interact with the command line jdb tool.
> 
> 
> On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <ru...@gold-family.us> wrote:
> 
>> Why do you want to do that? I suspect we are not getting at your actual
>> requirement.
>> 
>> On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <ap...@42six.com>
>> wrote:
>> 
>>> Yes, various Java IDEs can debug Java code, including Java code organized
>>> in Maven projects. What I'm interested in is debugging Java code in a
>> Maven
>>> project with an arbitrary text editor, not necessarily Eclipse or
>> Intellij,
>>> for example Emacs, or even Notepad, by invoking Maven tasks that point to
>>> Maven plugins that interact with jdb.
>>> 
>>> 
>>> On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <ns...@ebay.com>
>> wrote:
>>> 
>>>> It very is easy to debug maven from eclipse, I have documented how I
>> debug
>>>> maven-jetty-plugin using eclipse
>>>> 
>>>> 
>> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
>>>> 
>>>> -----Original Message-----
>>>> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
>>>> Sent: Thursday, October 10, 2013 11:04 AM
>>>> To: Maven Users List
>>>> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
>>>> 
>>>> I could also use an IDE for package management, but I'd rather use plain
>>>> Maven and an arbitrary text editor instead.
>>>> 
>>>> 
>>>> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <ru...@gold-family.us>
>>>> wrote:
>>>> 
>>>>> The simplest way to do this is actually to run it in your IDE directly.
>>>>> IntellijIDEA community edition can import your maven project and thus
>>>>> get all of the dependencies. Then you just run the program in the
>>>>> debugger. I presume Eclipse can do something similar.
>>>>> 
>>>>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
>>>>> <ap...@42six.com>
>>>>> wrote:
>>>>> 
>>>>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts
>>>>>> a
>>>>> jdb
>>>>>> session on <Class>.main().
>>>>>> 
>>>>>> I can run jdb on individual Java code outside of a Maven structure,
>>>>>> but
>>>>> I'm
>>>>>> not sure how to inform jdb of Java code in a Maven project, Maven's
>>>>>> CLASSPATH handling, etc. etc.
>>>>>> 
>>>>>> 
>>>>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
>>>>> bimargulies@gmail.com>wrote:
>>>>>> 
>>>>>>> What would that mean? Do you want to execute the program in the
>>>>> debugger?
>>>>>>> 
>>>>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
>>>>>>> <ap...@42six.com> wrote:
>>>>>>>> I'd like to run jdb over some of my classes in a Maven project. Is
>>>>> there
>>>>>>> a
>>>>>>>> plugin I can drop into my pom.xml?
>>>>>>> 
>>>>>>> -------------------------------------------------------------------
>>>>>>> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>> 
>>>>>>> 
>>>>> 
>>>>> -----------------
>>>>> Author, Getting Started with Apache Maven <
>>>>> http://www.packtpub.com/getting-started-with-apache-maven/video>
>>>>> 
>>>>> Come read my webnovel, Take a Lemon <http://www.takealemon.com>, and
>>>>> listen to the Misfile radio play <
>>>>> http://www.fuzzyfacetheater.com/misfile/>!
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>> 
>>>> 
>> 
>> -----------------
>> Author, Getting Started with Apache Maven <
>> http://www.packtpub.com/getting-started-with-apache-maven/video>
>> 
>> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
>> and listen to the Misfile radio play <
>> http://www.fuzzyfacetheater.com/misfile/>!
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 

-----------------
Author, Getting Started with Apache Maven <http://www.packtpub.com/getting-started-with-apache-maven/video>

Come read my webnovel, Take a Lemon <http://www.takealemon.com>, 
and listen to the Misfile radio play <http://www.fuzzyfacetheater.com/misfile/>!








Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Andrew Pennebaker <ap...@42six.com>.
/facepalm

Of course! Thanks again!


On Tue, Oct 15, 2013 at 3:08 PM, Curtis Rueden <ct...@wisc.edu> wrote:

> Hi Andrew,
>
> Cool, glad you got it working. And if you get sick of passing the FQCN you
> can of course do something like:
>
>   <argument>com.my.stuff.${jdb}</argument>
>
> Regards,
> Curtis
>
>
> On Tue, Oct 15, 2013 at 12:31 PM, Andrew Pennebaker
> <ap...@42six.com>wrote:
>
> > Ah, forgot to add the full namespace to the main class. This works:
> >
> > $ cat pom.xml
> > ...
> > <build>
> >   <plugins>
> >       <plugin>
> >         <groupId>org.codehaus.mojo</groupId>
> >         <artifactId>exec-maven-plugin</artifactId>
> >         <configuration>
> >           <executable>jdb</executable>
> >           <arguments>
> >             <argument>-classpath</argument>
> >             <classpath />
> >             <argument>${jdb}</argument>
> >           </arguments>
> >         </configuration>
> >         <executions>
> >           <execution>
> >             <goals>
> >               <goal>exec</goal>
> >             </goals>
> >           </execution>
> >         </executions>
> >       </plugin>
> > ...
> >
> > $ mvn -Djdb=com.my.stuff.HelloWorld exec:exec
> > run
> >
> >
> > On Tue, Oct 15, 2013 at 11:50 AM, Curtis Rueden <ct...@wisc.edu>
> wrote:
> >
> > > Hi Andrew,
> > >
> > > > Exception occurred: java.lang.ClassNotFoundException
> > > > (uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=202
> > bci=73
> > >
> > > Not sure what to tell you. I tested it with my project and was able to
> > > launch my app from jdb as usual; see:
> > >
> > >
> >
> https://github.com/imagej/imagej/commit/8cfe0fde7d89c71e083c992f5c7432b29f09c483
> > >
> > > > Are we sure the <argument>-classpath</argument><classpath /> bit is
> > > > the correct way to hand jdb the CLASSPATH?
> > >
> > > Yep, at least on my OS X system with Sun Java 1.7.0_21:
> > >
> > > $ jdb -version
> > > This is jdb version 1.6 (Java SE version 1.7.0_21)
> > >
> > > $ jdb -help | grep classpath
> > >     -classpath <directories separated by ":">
> > >
> > > Is your "HelloMaven" class really in the default package? What happens
> if
> > > you change "jdb" to "java" in your exec; can you launch your
> application
> > in
> > > non-debug mode that way? If not, there is something fishy with either
> > your
> > > java main class or your classpath.
> > >
> > > Regards,
> > > Curtis
> > >
> > >
> > > On Mon, Oct 14, 2013 at 8:56 AM, Andrew Pennebaker <
> > apennebaker@42six.com
> > > >wrote:
> > >
> > > > So close! I added the snippet inside my
> > > > <build><plugins>...</plugins></build> in pom.xml. Thanks for
> supplying
> > > the
> > > > exact code, by the way!
> > > >
> > > > But jdb is showing an error:
> > > >
> > > > $ mvn exec:exec -Djdb.mainClass=HelloMaven
> > > > Initializing jdb ...
> > > > > run
> > > > run HelloMaven
> > > > Set uncaught java.lang.Throwable
> > > > Set deferred uncaught java.lang.Throwable
> > > > >
> > > > VM Started:
> > > > Exception occurred: java.lang.ClassNotFoundException
> > > > (uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=202
> > bci=73
> > > >
> > > > main[1]
> > > >
> > > > This happens for any class I hand exec:exec.
> > > >
> > > > This is the same error I see if I try to jdb <Class> manually.
> > > >
> > > > Are we sure the <argument>-classpath</argument><classpath /> bit is
> the
> > > > correct way to hand jdb the CLASSPATH?
> > > >
> > > >
> > > > On Fri, Oct 11, 2013 at 4:20 PM, Curtis Rueden <ct...@wisc.edu>
> > > wrote:
> > > >
> > > > > Hi Andrew,
> > > > >
> > > > > > Could you elaborate on the exact <plugin>...</plugin> snippet I
> > would
> > > > > > need to drop into my pom.xml in order to achieve this?
> > > > >
> > > > > <plugin>
> > > > >   <groupId>org.codehaus.mojo</groupId>
> > > > >   <artifactId>exec-maven-plugin</artifactId>
> > > > >   <version>1.2.1</version>
> > > > >   <configuration>
> > > > >     <executable>jdb</executable>
> > > > >     <arguments>
> > > > >       <argument>-classpath</argument>
> > > > >       <classpath />
> > > > >       <argument>${jdb.mainClass}</argument>
> > > > >     </arguments>
> > > > >   </configuration>
> > > > >   <executions>
> > > > >     <execution>
> > > > >       <goals>
> > > > >         <goal>exec</goal>
> > > > >       </goals>
> > > > >     </execution>
> > > > >   </executions>
> > > > > </plugin>
> > > > >
> > > > > > If I could just `mvn exec:exec <Class>`, starting a jdb session
> on
> > > > > > <Class>.main(), that would be *perfect*.
> > > > >
> > > > > We can get close. If you use the block above, you would launch
> with:
> > > > >
> > > > >     mvn -Djdb.mainClass=<Class> exec:exec
> > > > >
> > > > > Where "jdb.mainClass" is the property used in the XML above. And if
> > > that
> > > > is
> > > > > not concise enough for your taste you can choose a property with a
> > > > shorter
> > > > > name.
> > > > >
> > > > > Working example inside a profile with a specific main class is
> here:
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/imagej/imagej/commit/8cfe0fde7d89c71e083c992f5c7432b29f09c483
> > > > >
> > > > > Regards,
> > > > > Curtis
> > > > >
> > > > >
> > > > > On Fri, Oct 11, 2013 at 1:47 PM, Andrew Pennebaker <
> > > > apennebaker@42six.com
> > > > > >wrote:
> > > > >
> > > > > > Thank you, Curtis, that looks like an excellent suggestion!
> > > > > >
> > > > > > Could you elaborate on the exact <plugin>...</plugin> snippet I
> > would
> > > > > need
> > > > > > to drop into my pom.xml in order to achieve this?
> > > > > >
> > > > > > If I could just `mvn exec:exec <Class>`, starting a jdb session
> on
> > > > > > <Class>.main(), that would be *perfect*.
> > > > > >
> > > > > >
> > > > > > On Fri, Oct 11, 2013 at 1:20 PM, Curtis Rueden <
> ctrueden@wisc.edu>
> > > > > wrote:
> > > > > >
> > > > > > > Hi all,
> > > > > > >
> > > > > > > Rather than getting into an eclipse vs. vim vs. emacs flamewar,
> > I'd
> > > > > > rather
> > > > > > > just ask: Andrew, did you try attaching your jdb to a running
> > java
> > > > > > instance
> > > > > > > launched via exec-maven-plugin as I suggested yet?
> > > > > > >
> > > > > > > You can configure exec-maven-plugin in your pom so that
> launching
> > > the
> > > > > > > compatible java process is as easy as "mvn exec:exec". You
> could
> > > even
> > > > > > > specify jdb as the executable directly if that's what you want
> > and
> > > > then
> > > > > > you
> > > > > > > wouldn't even need the attachment step. Using profiles (yes,
> this
> > > is
> > > > > one
> > > > > > of
> > > > > > > their benign uses!) you can even set up multiple different
> > > behaviors
> > > > of
> > > > > > > exec:exec for different common situations. Really I don't think
> > > there
> > > > > is
> > > > > > > any need whatsoever for a dedicated "mvn exec:jdb" here.
> > > > > > >
> > > > > > > -Curtis
> > > > > > > On Oct 11, 2013 10:53 AM, "Andrew Pennebaker" <
> > > apennebaker@42six.com
> > > > >
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Why would anyone want to do this? So we don't have to debug
> > Maven
> > > > > > > projects
> > > > > > > > with Eclipse/IntelliJ, but the text editor of our choice.
> This
> > is
> > > > > best
> > > > > > > > accomplished by Maven tasks which interact with the command
> > line
> > > > jdb
> > > > > > > tool.
> > > > > > > >
> > > > > > > >
> > > > > > > > On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <
> > > russ@gold-family.us
> > > > >
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Why do you want to do that? I suspect we are not getting at
> > > your
> > > > > > actual
> > > > > > > > > requirement.
> > > > > > > > >
> > > > > > > > > On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <
> > > > > > apennebaker@42six.com>
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > Yes, various Java IDEs can debug Java code, including
> Java
> > > code
> > > > > > > > organized
> > > > > > > > > > in Maven projects. What I'm interested in is debugging
> Java
> > > > code
> > > > > > in a
> > > > > > > > > Maven
> > > > > > > > > > project with an arbitrary text editor, not necessarily
> > > Eclipse
> > > > or
> > > > > > > > > Intellij,
> > > > > > > > > > for example Emacs, or even Notepad, by invoking Maven
> tasks
> > > > that
> > > > > > > point
> > > > > > > > to
> > > > > > > > > > Maven plugins that interact with jdb.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <
> > > > > > nsankaran@ebay.com
> > > > > > > >
> > > > > > > > > wrote:
> > > > > > > > > >
> > > > > > > > > >> It very is easy to debug maven from eclipse, I have
> > > documented
> > > > > > how I
> > > > > > > > > debug
> > > > > > > > > >> maven-jetty-plugin using eclipse
> > > > > > > > > >>
> > > > > > > > > >>
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
> > > > > > > > > >>
> > > > > > > > > >> -----Original Message-----
> > > > > > > > > >> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> > > > > > > > > >> Sent: Thursday, October 10, 2013 11:04 AM
> > > > > > > > > >> To: Maven Users List
> > > > > > > > > >> Subject: Re: Is there a Maven plugin for the Java
> debugger
> > > > > (jdb)?
> > > > > > > > > >>
> > > > > > > > > >> I could also use an IDE for package management, but I'd
> > > rather
> > > > > use
> > > > > > > > plain
> > > > > > > > > >> Maven and an arbitrary text editor instead.
> > > > > > > > > >>
> > > > > > > > > >>
> > > > > > > > > >> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <
> > > > > > russ@gold-family.us
> > > > > > > >
> > > > > > > > > >> wrote:
> > > > > > > > > >>
> > > > > > > > > >>> The simplest way to do this is actually to run it in
> your
> > > IDE
> > > > > > > > directly.
> > > > > > > > > >>> IntellijIDEA community edition can import your maven
> > > project
> > > > > and
> > > > > > > thus
> > > > > > > > > >>> get all of the dependencies. Then you just run the
> > program
> > > in
> > > > > the
> > > > > > > > > >>> debugger. I presume Eclipse can do something similar.
> > > > > > > > > >>>
> > > > > > > > > >>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> > > > > > > > > >>> <ap...@42six.com>
> > > > > > > > > >>> wrote:
> > > > > > > > > >>>
> > > > > > > > > >>>> Yes. I'm looking for a task like `mvn jdb:debug
> <Class>`
> > > > that
> > > > > > > starts
> > > > > > > > > >>>> a
> > > > > > > > > >>> jdb
> > > > > > > > > >>>> session on <Class>.main().
> > > > > > > > > >>>>
> > > > > > > > > >>>> I can run jdb on individual Java code outside of a
> Maven
> > > > > > > structure,
> > > > > > > > > >>>> but
> > > > > > > > > >>> I'm
> > > > > > > > > >>>> not sure how to inform jdb of Java code in a Maven
> > > project,
> > > > > > > Maven's
> > > > > > > > > >>>> CLASSPATH handling, etc. etc.
> > > > > > > > > >>>>
> > > > > > > > > >>>>
> > > > > > > > > >>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > > > > > > > > >>> bimargulies@gmail.com>wrote:
> > > > > > > > > >>>>
> > > > > > > > > >>>>> What would that mean? Do you want to execute the
> > program
> > > in
> > > > > the
> > > > > > > > > >>> debugger?
> > > > > > > > > >>>>>
> > > > > > > > > >>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> > > > > > > > > >>>>> <ap...@42six.com> wrote:
> > > > > > > > > >>>>>> I'd like to run jdb over some of my classes in a
> Maven
> > > > > > project.
> > > > > > > Is
> > > > > > > > > >>> there
> > > > > > > > > >>>>> a
> > > > > > > > > >>>>>> plugin I can drop into my pom.xml?
> > > > > > > > > >>>>>
> > > > > > > > > >>>>>
> > > > > > >
> > -------------------------------------------------------------------
> > > > > > > > > >>>>> -- To unsubscribe, e-mail:
> > > > > users-unsubscribe@maven.apache.org
> > > > > > > > > >>>>> For additional commands, e-mail:
> > > > users-help@maven.apache.org
> > > > > > > > > >>>>>
> > > > > > > > > >>>>>
> > > > > > > > > >>>
> > > > > > > > > >>> -----------------
> > > > > > > > > >>> Author, Getting Started with Apache Maven <
> > > > > > > > > >>>
> > > > > http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > > > > > > > >>>
> > > > > > > > > >>> Come read my webnovel, Take a Lemon <
> > > > http://www.takealemon.com
> > > > > >,
> > > > > > > and
> > > > > > > > > >>> listen to the Misfile radio play <
> > > > > > > > > >>> http://www.fuzzyfacetheater.com/misfile/>!
> > > > > > > > > >>>
> > > > > > > > > >>>
> > > > > > > > > >>>
> > > > > > > > > >>>
> > > > > > > > > >>>
> > > > > > > > > >>>
> > > > > > > > > >>>
> > > > > > > > > >>>
> > > > > > > > > >>
> > > > > > > > > >>
> > > > > > >
> > > ---------------------------------------------------------------------
> > > > > > > > > >> To unsubscribe, e-mail:
> > users-unsubscribe@maven.apache.org
> > > > > > > > > >> For additional commands, e-mail:
> > > users-help@maven.apache.org
> > > > > > > > > >>
> > > > > > > > > >>
> > > > > > > > >
> > > > > > > > > -----------------
> > > > > > > > > Author, Getting Started with Apache Maven <
> > > > > > > > >
> > > http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > > > > > > >
> > > > > > > > > Come read my webnovel, Take a Lemon <
> > http://www.takealemon.com
> > > >,
> > > > > > > > > and listen to the Misfile radio play <
> > > > > > > > > http://www.fuzzyfacetheater.com/misfile/>!
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> > Cheers,
> >
> > Andrew Pennebaker
> > apennebaker@42six.com
> >
>



-- 
Cheers,

Andrew Pennebaker
apennebaker@42six.com

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Andrew,

Cool, glad you got it working. And if you get sick of passing the FQCN you
can of course do something like:

  <argument>com.my.stuff.${jdb}</argument>

Regards,
Curtis


On Tue, Oct 15, 2013 at 12:31 PM, Andrew Pennebaker
<ap...@42six.com>wrote:

> Ah, forgot to add the full namespace to the main class. This works:
>
> $ cat pom.xml
> ...
> <build>
>   <plugins>
>       <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>exec-maven-plugin</artifactId>
>         <configuration>
>           <executable>jdb</executable>
>           <arguments>
>             <argument>-classpath</argument>
>             <classpath />
>             <argument>${jdb}</argument>
>           </arguments>
>         </configuration>
>         <executions>
>           <execution>
>             <goals>
>               <goal>exec</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
> ...
>
> $ mvn -Djdb=com.my.stuff.HelloWorld exec:exec
> run
>
>
> On Tue, Oct 15, 2013 at 11:50 AM, Curtis Rueden <ct...@wisc.edu> wrote:
>
> > Hi Andrew,
> >
> > > Exception occurred: java.lang.ClassNotFoundException
> > > (uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=202
> bci=73
> >
> > Not sure what to tell you. I tested it with my project and was able to
> > launch my app from jdb as usual; see:
> >
> >
> https://github.com/imagej/imagej/commit/8cfe0fde7d89c71e083c992f5c7432b29f09c483
> >
> > > Are we sure the <argument>-classpath</argument><classpath /> bit is
> > > the correct way to hand jdb the CLASSPATH?
> >
> > Yep, at least on my OS X system with Sun Java 1.7.0_21:
> >
> > $ jdb -version
> > This is jdb version 1.6 (Java SE version 1.7.0_21)
> >
> > $ jdb -help | grep classpath
> >     -classpath <directories separated by ":">
> >
> > Is your "HelloMaven" class really in the default package? What happens if
> > you change "jdb" to "java" in your exec; can you launch your application
> in
> > non-debug mode that way? If not, there is something fishy with either
> your
> > java main class or your classpath.
> >
> > Regards,
> > Curtis
> >
> >
> > On Mon, Oct 14, 2013 at 8:56 AM, Andrew Pennebaker <
> apennebaker@42six.com
> > >wrote:
> >
> > > So close! I added the snippet inside my
> > > <build><plugins>...</plugins></build> in pom.xml. Thanks for supplying
> > the
> > > exact code, by the way!
> > >
> > > But jdb is showing an error:
> > >
> > > $ mvn exec:exec -Djdb.mainClass=HelloMaven
> > > Initializing jdb ...
> > > > run
> > > run HelloMaven
> > > Set uncaught java.lang.Throwable
> > > Set deferred uncaught java.lang.Throwable
> > > >
> > > VM Started:
> > > Exception occurred: java.lang.ClassNotFoundException
> > > (uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=202
> bci=73
> > >
> > > main[1]
> > >
> > > This happens for any class I hand exec:exec.
> > >
> > > This is the same error I see if I try to jdb <Class> manually.
> > >
> > > Are we sure the <argument>-classpath</argument><classpath /> bit is the
> > > correct way to hand jdb the CLASSPATH?
> > >
> > >
> > > On Fri, Oct 11, 2013 at 4:20 PM, Curtis Rueden <ct...@wisc.edu>
> > wrote:
> > >
> > > > Hi Andrew,
> > > >
> > > > > Could you elaborate on the exact <plugin>...</plugin> snippet I
> would
> > > > > need to drop into my pom.xml in order to achieve this?
> > > >
> > > > <plugin>
> > > >   <groupId>org.codehaus.mojo</groupId>
> > > >   <artifactId>exec-maven-plugin</artifactId>
> > > >   <version>1.2.1</version>
> > > >   <configuration>
> > > >     <executable>jdb</executable>
> > > >     <arguments>
> > > >       <argument>-classpath</argument>
> > > >       <classpath />
> > > >       <argument>${jdb.mainClass}</argument>
> > > >     </arguments>
> > > >   </configuration>
> > > >   <executions>
> > > >     <execution>
> > > >       <goals>
> > > >         <goal>exec</goal>
> > > >       </goals>
> > > >     </execution>
> > > >   </executions>
> > > > </plugin>
> > > >
> > > > > If I could just `mvn exec:exec <Class>`, starting a jdb session on
> > > > > <Class>.main(), that would be *perfect*.
> > > >
> > > > We can get close. If you use the block above, you would launch with:
> > > >
> > > >     mvn -Djdb.mainClass=<Class> exec:exec
> > > >
> > > > Where "jdb.mainClass" is the property used in the XML above. And if
> > that
> > > is
> > > > not concise enough for your taste you can choose a property with a
> > > shorter
> > > > name.
> > > >
> > > > Working example inside a profile with a specific main class is here:
> > > >
> > > >
> > > >
> > >
> >
> https://github.com/imagej/imagej/commit/8cfe0fde7d89c71e083c992f5c7432b29f09c483
> > > >
> > > > Regards,
> > > > Curtis
> > > >
> > > >
> > > > On Fri, Oct 11, 2013 at 1:47 PM, Andrew Pennebaker <
> > > apennebaker@42six.com
> > > > >wrote:
> > > >
> > > > > Thank you, Curtis, that looks like an excellent suggestion!
> > > > >
> > > > > Could you elaborate on the exact <plugin>...</plugin> snippet I
> would
> > > > need
> > > > > to drop into my pom.xml in order to achieve this?
> > > > >
> > > > > If I could just `mvn exec:exec <Class>`, starting a jdb session on
> > > > > <Class>.main(), that would be *perfect*.
> > > > >
> > > > >
> > > > > On Fri, Oct 11, 2013 at 1:20 PM, Curtis Rueden <ct...@wisc.edu>
> > > > wrote:
> > > > >
> > > > > > Hi all,
> > > > > >
> > > > > > Rather than getting into an eclipse vs. vim vs. emacs flamewar,
> I'd
> > > > > rather
> > > > > > just ask: Andrew, did you try attaching your jdb to a running
> java
> > > > > instance
> > > > > > launched via exec-maven-plugin as I suggested yet?
> > > > > >
> > > > > > You can configure exec-maven-plugin in your pom so that launching
> > the
> > > > > > compatible java process is as easy as "mvn exec:exec". You could
> > even
> > > > > > specify jdb as the executable directly if that's what you want
> and
> > > then
> > > > > you
> > > > > > wouldn't even need the attachment step. Using profiles (yes, this
> > is
> > > > one
> > > > > of
> > > > > > their benign uses!) you can even set up multiple different
> > behaviors
> > > of
> > > > > > exec:exec for different common situations. Really I don't think
> > there
> > > > is
> > > > > > any need whatsoever for a dedicated "mvn exec:jdb" here.
> > > > > >
> > > > > > -Curtis
> > > > > > On Oct 11, 2013 10:53 AM, "Andrew Pennebaker" <
> > apennebaker@42six.com
> > > >
> > > > > > wrote:
> > > > > >
> > > > > > > Why would anyone want to do this? So we don't have to debug
> Maven
> > > > > > projects
> > > > > > > with Eclipse/IntelliJ, but the text editor of our choice. This
> is
> > > > best
> > > > > > > accomplished by Maven tasks which interact with the command
> line
> > > jdb
> > > > > > tool.
> > > > > > >
> > > > > > >
> > > > > > > On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <
> > russ@gold-family.us
> > > >
> > > > > > wrote:
> > > > > > >
> > > > > > > > Why do you want to do that? I suspect we are not getting at
> > your
> > > > > actual
> > > > > > > > requirement.
> > > > > > > >
> > > > > > > > On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <
> > > > > apennebaker@42six.com>
> > > > > > > > wrote:
> > > > > > > >
> > > > > > > > > Yes, various Java IDEs can debug Java code, including Java
> > code
> > > > > > > organized
> > > > > > > > > in Maven projects. What I'm interested in is debugging Java
> > > code
> > > > > in a
> > > > > > > > Maven
> > > > > > > > > project with an arbitrary text editor, not necessarily
> > Eclipse
> > > or
> > > > > > > > Intellij,
> > > > > > > > > for example Emacs, or even Notepad, by invoking Maven tasks
> > > that
> > > > > > point
> > > > > > > to
> > > > > > > > > Maven plugins that interact with jdb.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <
> > > > > nsankaran@ebay.com
> > > > > > >
> > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > >> It very is easy to debug maven from eclipse, I have
> > documented
> > > > > how I
> > > > > > > > debug
> > > > > > > > >> maven-jetty-plugin using eclipse
> > > > > > > > >>
> > > > > > > > >>
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
> > > > > > > > >>
> > > > > > > > >> -----Original Message-----
> > > > > > > > >> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> > > > > > > > >> Sent: Thursday, October 10, 2013 11:04 AM
> > > > > > > > >> To: Maven Users List
> > > > > > > > >> Subject: Re: Is there a Maven plugin for the Java debugger
> > > > (jdb)?
> > > > > > > > >>
> > > > > > > > >> I could also use an IDE for package management, but I'd
> > rather
> > > > use
> > > > > > > plain
> > > > > > > > >> Maven and an arbitrary text editor instead.
> > > > > > > > >>
> > > > > > > > >>
> > > > > > > > >> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <
> > > > > russ@gold-family.us
> > > > > > >
> > > > > > > > >> wrote:
> > > > > > > > >>
> > > > > > > > >>> The simplest way to do this is actually to run it in your
> > IDE
> > > > > > > directly.
> > > > > > > > >>> IntellijIDEA community edition can import your maven
> > project
> > > > and
> > > > > > thus
> > > > > > > > >>> get all of the dependencies. Then you just run the
> program
> > in
> > > > the
> > > > > > > > >>> debugger. I presume Eclipse can do something similar.
> > > > > > > > >>>
> > > > > > > > >>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> > > > > > > > >>> <ap...@42six.com>
> > > > > > > > >>> wrote:
> > > > > > > > >>>
> > > > > > > > >>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>`
> > > that
> > > > > > starts
> > > > > > > > >>>> a
> > > > > > > > >>> jdb
> > > > > > > > >>>> session on <Class>.main().
> > > > > > > > >>>>
> > > > > > > > >>>> I can run jdb on individual Java code outside of a Maven
> > > > > > structure,
> > > > > > > > >>>> but
> > > > > > > > >>> I'm
> > > > > > > > >>>> not sure how to inform jdb of Java code in a Maven
> > project,
> > > > > > Maven's
> > > > > > > > >>>> CLASSPATH handling, etc. etc.
> > > > > > > > >>>>
> > > > > > > > >>>>
> > > > > > > > >>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > > > > > > > >>> bimargulies@gmail.com>wrote:
> > > > > > > > >>>>
> > > > > > > > >>>>> What would that mean? Do you want to execute the
> program
> > in
> > > > the
> > > > > > > > >>> debugger?
> > > > > > > > >>>>>
> > > > > > > > >>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> > > > > > > > >>>>> <ap...@42six.com> wrote:
> > > > > > > > >>>>>> I'd like to run jdb over some of my classes in a Maven
> > > > > project.
> > > > > > Is
> > > > > > > > >>> there
> > > > > > > > >>>>> a
> > > > > > > > >>>>>> plugin I can drop into my pom.xml?
> > > > > > > > >>>>>
> > > > > > > > >>>>>
> > > > > >
> -------------------------------------------------------------------
> > > > > > > > >>>>> -- To unsubscribe, e-mail:
> > > > users-unsubscribe@maven.apache.org
> > > > > > > > >>>>> For additional commands, e-mail:
> > > users-help@maven.apache.org
> > > > > > > > >>>>>
> > > > > > > > >>>>>
> > > > > > > > >>>
> > > > > > > > >>> -----------------
> > > > > > > > >>> Author, Getting Started with Apache Maven <
> > > > > > > > >>>
> > > > http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > > > > > > >>>
> > > > > > > > >>> Come read my webnovel, Take a Lemon <
> > > http://www.takealemon.com
> > > > >,
> > > > > > and
> > > > > > > > >>> listen to the Misfile radio play <
> > > > > > > > >>> http://www.fuzzyfacetheater.com/misfile/>!
> > > > > > > > >>>
> > > > > > > > >>>
> > > > > > > > >>>
> > > > > > > > >>>
> > > > > > > > >>>
> > > > > > > > >>>
> > > > > > > > >>>
> > > > > > > > >>>
> > > > > > > > >>
> > > > > > > > >>
> > > > > >
> > ---------------------------------------------------------------------
> > > > > > > > >> To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> > > > > > > > >> For additional commands, e-mail:
> > users-help@maven.apache.org
> > > > > > > > >>
> > > > > > > > >>
> > > > > > > >
> > > > > > > > -----------------
> > > > > > > > Author, Getting Started with Apache Maven <
> > > > > > > >
> > http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > > > > > >
> > > > > > > > Come read my webnovel, Take a Lemon <
> http://www.takealemon.com
> > >,
> > > > > > > > and listen to the Misfile radio play <
> > > > > > > > http://www.fuzzyfacetheater.com/misfile/>!
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
>
>
> --
> Cheers,
>
> Andrew Pennebaker
> apennebaker@42six.com
>

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Andrew Pennebaker <ap...@42six.com>.
Ah, forgot to add the full namespace to the main class. This works:

$ cat pom.xml
...
<build>
  <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <configuration>
          <executable>jdb</executable>
          <arguments>
            <argument>-classpath</argument>
            <classpath />
            <argument>${jdb}</argument>
          </arguments>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
...

$ mvn -Djdb=com.my.stuff.HelloWorld exec:exec
run


On Tue, Oct 15, 2013 at 11:50 AM, Curtis Rueden <ct...@wisc.edu> wrote:

> Hi Andrew,
>
> > Exception occurred: java.lang.ClassNotFoundException
> > (uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=202 bci=73
>
> Not sure what to tell you. I tested it with my project and was able to
> launch my app from jdb as usual; see:
>
> https://github.com/imagej/imagej/commit/8cfe0fde7d89c71e083c992f5c7432b29f09c483
>
> > Are we sure the <argument>-classpath</argument><classpath /> bit is
> > the correct way to hand jdb the CLASSPATH?
>
> Yep, at least on my OS X system with Sun Java 1.7.0_21:
>
> $ jdb -version
> This is jdb version 1.6 (Java SE version 1.7.0_21)
>
> $ jdb -help | grep classpath
>     -classpath <directories separated by ":">
>
> Is your "HelloMaven" class really in the default package? What happens if
> you change "jdb" to "java" in your exec; can you launch your application in
> non-debug mode that way? If not, there is something fishy with either your
> java main class or your classpath.
>
> Regards,
> Curtis
>
>
> On Mon, Oct 14, 2013 at 8:56 AM, Andrew Pennebaker <apennebaker@42six.com
> >wrote:
>
> > So close! I added the snippet inside my
> > <build><plugins>...</plugins></build> in pom.xml. Thanks for supplying
> the
> > exact code, by the way!
> >
> > But jdb is showing an error:
> >
> > $ mvn exec:exec -Djdb.mainClass=HelloMaven
> > Initializing jdb ...
> > > run
> > run HelloMaven
> > Set uncaught java.lang.Throwable
> > Set deferred uncaught java.lang.Throwable
> > >
> > VM Started:
> > Exception occurred: java.lang.ClassNotFoundException
> > (uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=202 bci=73
> >
> > main[1]
> >
> > This happens for any class I hand exec:exec.
> >
> > This is the same error I see if I try to jdb <Class> manually.
> >
> > Are we sure the <argument>-classpath</argument><classpath /> bit is the
> > correct way to hand jdb the CLASSPATH?
> >
> >
> > On Fri, Oct 11, 2013 at 4:20 PM, Curtis Rueden <ct...@wisc.edu>
> wrote:
> >
> > > Hi Andrew,
> > >
> > > > Could you elaborate on the exact <plugin>...</plugin> snippet I would
> > > > need to drop into my pom.xml in order to achieve this?
> > >
> > > <plugin>
> > >   <groupId>org.codehaus.mojo</groupId>
> > >   <artifactId>exec-maven-plugin</artifactId>
> > >   <version>1.2.1</version>
> > >   <configuration>
> > >     <executable>jdb</executable>
> > >     <arguments>
> > >       <argument>-classpath</argument>
> > >       <classpath />
> > >       <argument>${jdb.mainClass}</argument>
> > >     </arguments>
> > >   </configuration>
> > >   <executions>
> > >     <execution>
> > >       <goals>
> > >         <goal>exec</goal>
> > >       </goals>
> > >     </execution>
> > >   </executions>
> > > </plugin>
> > >
> > > > If I could just `mvn exec:exec <Class>`, starting a jdb session on
> > > > <Class>.main(), that would be *perfect*.
> > >
> > > We can get close. If you use the block above, you would launch with:
> > >
> > >     mvn -Djdb.mainClass=<Class> exec:exec
> > >
> > > Where "jdb.mainClass" is the property used in the XML above. And if
> that
> > is
> > > not concise enough for your taste you can choose a property with a
> > shorter
> > > name.
> > >
> > > Working example inside a profile with a specific main class is here:
> > >
> > >
> > >
> >
> https://github.com/imagej/imagej/commit/8cfe0fde7d89c71e083c992f5c7432b29f09c483
> > >
> > > Regards,
> > > Curtis
> > >
> > >
> > > On Fri, Oct 11, 2013 at 1:47 PM, Andrew Pennebaker <
> > apennebaker@42six.com
> > > >wrote:
> > >
> > > > Thank you, Curtis, that looks like an excellent suggestion!
> > > >
> > > > Could you elaborate on the exact <plugin>...</plugin> snippet I would
> > > need
> > > > to drop into my pom.xml in order to achieve this?
> > > >
> > > > If I could just `mvn exec:exec <Class>`, starting a jdb session on
> > > > <Class>.main(), that would be *perfect*.
> > > >
> > > >
> > > > On Fri, Oct 11, 2013 at 1:20 PM, Curtis Rueden <ct...@wisc.edu>
> > > wrote:
> > > >
> > > > > Hi all,
> > > > >
> > > > > Rather than getting into an eclipse vs. vim vs. emacs flamewar, I'd
> > > > rather
> > > > > just ask: Andrew, did you try attaching your jdb to a running java
> > > > instance
> > > > > launched via exec-maven-plugin as I suggested yet?
> > > > >
> > > > > You can configure exec-maven-plugin in your pom so that launching
> the
> > > > > compatible java process is as easy as "mvn exec:exec". You could
> even
> > > > > specify jdb as the executable directly if that's what you want and
> > then
> > > > you
> > > > > wouldn't even need the attachment step. Using profiles (yes, this
> is
> > > one
> > > > of
> > > > > their benign uses!) you can even set up multiple different
> behaviors
> > of
> > > > > exec:exec for different common situations. Really I don't think
> there
> > > is
> > > > > any need whatsoever for a dedicated "mvn exec:jdb" here.
> > > > >
> > > > > -Curtis
> > > > > On Oct 11, 2013 10:53 AM, "Andrew Pennebaker" <
> apennebaker@42six.com
> > >
> > > > > wrote:
> > > > >
> > > > > > Why would anyone want to do this? So we don't have to debug Maven
> > > > > projects
> > > > > > with Eclipse/IntelliJ, but the text editor of our choice. This is
> > > best
> > > > > > accomplished by Maven tasks which interact with the command line
> > jdb
> > > > > tool.
> > > > > >
> > > > > >
> > > > > > On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <
> russ@gold-family.us
> > >
> > > > > wrote:
> > > > > >
> > > > > > > Why do you want to do that? I suspect we are not getting at
> your
> > > > actual
> > > > > > > requirement.
> > > > > > >
> > > > > > > On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <
> > > > apennebaker@42six.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > Yes, various Java IDEs can debug Java code, including Java
> code
> > > > > > organized
> > > > > > > > in Maven projects. What I'm interested in is debugging Java
> > code
> > > > in a
> > > > > > > Maven
> > > > > > > > project with an arbitrary text editor, not necessarily
> Eclipse
> > or
> > > > > > > Intellij,
> > > > > > > > for example Emacs, or even Notepad, by invoking Maven tasks
> > that
> > > > > point
> > > > > > to
> > > > > > > > Maven plugins that interact with jdb.
> > > > > > > >
> > > > > > > >
> > > > > > > > On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <
> > > > nsankaran@ebay.com
> > > > > >
> > > > > > > wrote:
> > > > > > > >
> > > > > > > >> It very is easy to debug maven from eclipse, I have
> documented
> > > > how I
> > > > > > > debug
> > > > > > > >> maven-jetty-plugin using eclipse
> > > > > > > >>
> > > > > > > >>
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
> > > > > > > >>
> > > > > > > >> -----Original Message-----
> > > > > > > >> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> > > > > > > >> Sent: Thursday, October 10, 2013 11:04 AM
> > > > > > > >> To: Maven Users List
> > > > > > > >> Subject: Re: Is there a Maven plugin for the Java debugger
> > > (jdb)?
> > > > > > > >>
> > > > > > > >> I could also use an IDE for package management, but I'd
> rather
> > > use
> > > > > > plain
> > > > > > > >> Maven and an arbitrary text editor instead.
> > > > > > > >>
> > > > > > > >>
> > > > > > > >> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <
> > > > russ@gold-family.us
> > > > > >
> > > > > > > >> wrote:
> > > > > > > >>
> > > > > > > >>> The simplest way to do this is actually to run it in your
> IDE
> > > > > > directly.
> > > > > > > >>> IntellijIDEA community edition can import your maven
> project
> > > and
> > > > > thus
> > > > > > > >>> get all of the dependencies. Then you just run the program
> in
> > > the
> > > > > > > >>> debugger. I presume Eclipse can do something similar.
> > > > > > > >>>
> > > > > > > >>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> > > > > > > >>> <ap...@42six.com>
> > > > > > > >>> wrote:
> > > > > > > >>>
> > > > > > > >>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>`
> > that
> > > > > starts
> > > > > > > >>>> a
> > > > > > > >>> jdb
> > > > > > > >>>> session on <Class>.main().
> > > > > > > >>>>
> > > > > > > >>>> I can run jdb on individual Java code outside of a Maven
> > > > > structure,
> > > > > > > >>>> but
> > > > > > > >>> I'm
> > > > > > > >>>> not sure how to inform jdb of Java code in a Maven
> project,
> > > > > Maven's
> > > > > > > >>>> CLASSPATH handling, etc. etc.
> > > > > > > >>>>
> > > > > > > >>>>
> > > > > > > >>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > > > > > > >>> bimargulies@gmail.com>wrote:
> > > > > > > >>>>
> > > > > > > >>>>> What would that mean? Do you want to execute the program
> in
> > > the
> > > > > > > >>> debugger?
> > > > > > > >>>>>
> > > > > > > >>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> > > > > > > >>>>> <ap...@42six.com> wrote:
> > > > > > > >>>>>> I'd like to run jdb over some of my classes in a Maven
> > > > project.
> > > > > Is
> > > > > > > >>> there
> > > > > > > >>>>> a
> > > > > > > >>>>>> plugin I can drop into my pom.xml?
> > > > > > > >>>>>
> > > > > > > >>>>>
> > > > > -------------------------------------------------------------------
> > > > > > > >>>>> -- To unsubscribe, e-mail:
> > > users-unsubscribe@maven.apache.org
> > > > > > > >>>>> For additional commands, e-mail:
> > users-help@maven.apache.org
> > > > > > > >>>>>
> > > > > > > >>>>>
> > > > > > > >>>
> > > > > > > >>> -----------------
> > > > > > > >>> Author, Getting Started with Apache Maven <
> > > > > > > >>>
> > > http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > > > > > >>>
> > > > > > > >>> Come read my webnovel, Take a Lemon <
> > http://www.takealemon.com
> > > >,
> > > > > and
> > > > > > > >>> listen to the Misfile radio play <
> > > > > > > >>> http://www.fuzzyfacetheater.com/misfile/>!
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>>
> > > > > > > >>
> > > > > > > >>
> > > > >
> ---------------------------------------------------------------------
> > > > > > > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > > > > >> For additional commands, e-mail:
> users-help@maven.apache.org
> > > > > > > >>
> > > > > > > >>
> > > > > > >
> > > > > > > -----------------
> > > > > > > Author, Getting Started with Apache Maven <
> > > > > > >
> http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > > > > >
> > > > > > > Come read my webnovel, Take a Lemon <http://www.takealemon.com
> >,
> > > > > > > and listen to the Misfile radio play <
> > > > > > > http://www.fuzzyfacetheater.com/misfile/>!
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>



-- 
Cheers,

Andrew Pennebaker
apennebaker@42six.com

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Andrew,

> Exception occurred: java.lang.ClassNotFoundException
> (uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=202 bci=73

Not sure what to tell you. I tested it with my project and was able to
launch my app from jdb as usual; see:
https://github.com/imagej/imagej/commit/8cfe0fde7d89c71e083c992f5c7432b29f09c483

> Are we sure the <argument>-classpath</argument><classpath /> bit is
> the correct way to hand jdb the CLASSPATH?

Yep, at least on my OS X system with Sun Java 1.7.0_21:

$ jdb -version
This is jdb version 1.6 (Java SE version 1.7.0_21)

$ jdb -help | grep classpath
    -classpath <directories separated by ":">

Is your "HelloMaven" class really in the default package? What happens if
you change "jdb" to "java" in your exec; can you launch your application in
non-debug mode that way? If not, there is something fishy with either your
java main class or your classpath.

Regards,
Curtis


On Mon, Oct 14, 2013 at 8:56 AM, Andrew Pennebaker <ap...@42six.com>wrote:

> So close! I added the snippet inside my
> <build><plugins>...</plugins></build> in pom.xml. Thanks for supplying the
> exact code, by the way!
>
> But jdb is showing an error:
>
> $ mvn exec:exec -Djdb.mainClass=HelloMaven
> Initializing jdb ...
> > run
> run HelloMaven
> Set uncaught java.lang.Throwable
> Set deferred uncaught java.lang.Throwable
> >
> VM Started:
> Exception occurred: java.lang.ClassNotFoundException
> (uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=202 bci=73
>
> main[1]
>
> This happens for any class I hand exec:exec.
>
> This is the same error I see if I try to jdb <Class> manually.
>
> Are we sure the <argument>-classpath</argument><classpath /> bit is the
> correct way to hand jdb the CLASSPATH?
>
>
> On Fri, Oct 11, 2013 at 4:20 PM, Curtis Rueden <ct...@wisc.edu> wrote:
>
> > Hi Andrew,
> >
> > > Could you elaborate on the exact <plugin>...</plugin> snippet I would
> > > need to drop into my pom.xml in order to achieve this?
> >
> > <plugin>
> >   <groupId>org.codehaus.mojo</groupId>
> >   <artifactId>exec-maven-plugin</artifactId>
> >   <version>1.2.1</version>
> >   <configuration>
> >     <executable>jdb</executable>
> >     <arguments>
> >       <argument>-classpath</argument>
> >       <classpath />
> >       <argument>${jdb.mainClass}</argument>
> >     </arguments>
> >   </configuration>
> >   <executions>
> >     <execution>
> >       <goals>
> >         <goal>exec</goal>
> >       </goals>
> >     </execution>
> >   </executions>
> > </plugin>
> >
> > > If I could just `mvn exec:exec <Class>`, starting a jdb session on
> > > <Class>.main(), that would be *perfect*.
> >
> > We can get close. If you use the block above, you would launch with:
> >
> >     mvn -Djdb.mainClass=<Class> exec:exec
> >
> > Where "jdb.mainClass" is the property used in the XML above. And if that
> is
> > not concise enough for your taste you can choose a property with a
> shorter
> > name.
> >
> > Working example inside a profile with a specific main class is here:
> >
> >
> >
> https://github.com/imagej/imagej/commit/8cfe0fde7d89c71e083c992f5c7432b29f09c483
> >
> > Regards,
> > Curtis
> >
> >
> > On Fri, Oct 11, 2013 at 1:47 PM, Andrew Pennebaker <
> apennebaker@42six.com
> > >wrote:
> >
> > > Thank you, Curtis, that looks like an excellent suggestion!
> > >
> > > Could you elaborate on the exact <plugin>...</plugin> snippet I would
> > need
> > > to drop into my pom.xml in order to achieve this?
> > >
> > > If I could just `mvn exec:exec <Class>`, starting a jdb session on
> > > <Class>.main(), that would be *perfect*.
> > >
> > >
> > > On Fri, Oct 11, 2013 at 1:20 PM, Curtis Rueden <ct...@wisc.edu>
> > wrote:
> > >
> > > > Hi all,
> > > >
> > > > Rather than getting into an eclipse vs. vim vs. emacs flamewar, I'd
> > > rather
> > > > just ask: Andrew, did you try attaching your jdb to a running java
> > > instance
> > > > launched via exec-maven-plugin as I suggested yet?
> > > >
> > > > You can configure exec-maven-plugin in your pom so that launching the
> > > > compatible java process is as easy as "mvn exec:exec". You could even
> > > > specify jdb as the executable directly if that's what you want and
> then
> > > you
> > > > wouldn't even need the attachment step. Using profiles (yes, this is
> > one
> > > of
> > > > their benign uses!) you can even set up multiple different behaviors
> of
> > > > exec:exec for different common situations. Really I don't think there
> > is
> > > > any need whatsoever for a dedicated "mvn exec:jdb" here.
> > > >
> > > > -Curtis
> > > > On Oct 11, 2013 10:53 AM, "Andrew Pennebaker" <apennebaker@42six.com
> >
> > > > wrote:
> > > >
> > > > > Why would anyone want to do this? So we don't have to debug Maven
> > > > projects
> > > > > with Eclipse/IntelliJ, but the text editor of our choice. This is
> > best
> > > > > accomplished by Maven tasks which interact with the command line
> jdb
> > > > tool.
> > > > >
> > > > >
> > > > > On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <russ@gold-family.us
> >
> > > > wrote:
> > > > >
> > > > > > Why do you want to do that? I suspect we are not getting at your
> > > actual
> > > > > > requirement.
> > > > > >
> > > > > > On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <
> > > apennebaker@42six.com>
> > > > > > wrote:
> > > > > >
> > > > > > > Yes, various Java IDEs can debug Java code, including Java code
> > > > > organized
> > > > > > > in Maven projects. What I'm interested in is debugging Java
> code
> > > in a
> > > > > > Maven
> > > > > > > project with an arbitrary text editor, not necessarily Eclipse
> or
> > > > > > Intellij,
> > > > > > > for example Emacs, or even Notepad, by invoking Maven tasks
> that
> > > > point
> > > > > to
> > > > > > > Maven plugins that interact with jdb.
> > > > > > >
> > > > > > >
> > > > > > > On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <
> > > nsankaran@ebay.com
> > > > >
> > > > > > wrote:
> > > > > > >
> > > > > > >> It very is easy to debug maven from eclipse, I have documented
> > > how I
> > > > > > debug
> > > > > > >> maven-jetty-plugin using eclipse
> > > > > > >>
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
> > > > > > >>
> > > > > > >> -----Original Message-----
> > > > > > >> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> > > > > > >> Sent: Thursday, October 10, 2013 11:04 AM
> > > > > > >> To: Maven Users List
> > > > > > >> Subject: Re: Is there a Maven plugin for the Java debugger
> > (jdb)?
> > > > > > >>
> > > > > > >> I could also use an IDE for package management, but I'd rather
> > use
> > > > > plain
> > > > > > >> Maven and an arbitrary text editor instead.
> > > > > > >>
> > > > > > >>
> > > > > > >> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <
> > > russ@gold-family.us
> > > > >
> > > > > > >> wrote:
> > > > > > >>
> > > > > > >>> The simplest way to do this is actually to run it in your IDE
> > > > > directly.
> > > > > > >>> IntellijIDEA community edition can import your maven project
> > and
> > > > thus
> > > > > > >>> get all of the dependencies. Then you just run the program in
> > the
> > > > > > >>> debugger. I presume Eclipse can do something similar.
> > > > > > >>>
> > > > > > >>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> > > > > > >>> <ap...@42six.com>
> > > > > > >>> wrote:
> > > > > > >>>
> > > > > > >>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>`
> that
> > > > starts
> > > > > > >>>> a
> > > > > > >>> jdb
> > > > > > >>>> session on <Class>.main().
> > > > > > >>>>
> > > > > > >>>> I can run jdb on individual Java code outside of a Maven
> > > > structure,
> > > > > > >>>> but
> > > > > > >>> I'm
> > > > > > >>>> not sure how to inform jdb of Java code in a Maven project,
> > > > Maven's
> > > > > > >>>> CLASSPATH handling, etc. etc.
> > > > > > >>>>
> > > > > > >>>>
> > > > > > >>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > > > > > >>> bimargulies@gmail.com>wrote:
> > > > > > >>>>
> > > > > > >>>>> What would that mean? Do you want to execute the program in
> > the
> > > > > > >>> debugger?
> > > > > > >>>>>
> > > > > > >>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> > > > > > >>>>> <ap...@42six.com> wrote:
> > > > > > >>>>>> I'd like to run jdb over some of my classes in a Maven
> > > project.
> > > > Is
> > > > > > >>> there
> > > > > > >>>>> a
> > > > > > >>>>>> plugin I can drop into my pom.xml?
> > > > > > >>>>>
> > > > > > >>>>>
> > > > -------------------------------------------------------------------
> > > > > > >>>>> -- To unsubscribe, e-mail:
> > users-unsubscribe@maven.apache.org
> > > > > > >>>>> For additional commands, e-mail:
> users-help@maven.apache.org
> > > > > > >>>>>
> > > > > > >>>>>
> > > > > > >>>
> > > > > > >>> -----------------
> > > > > > >>> Author, Getting Started with Apache Maven <
> > > > > > >>>
> > http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > > > > >>>
> > > > > > >>> Come read my webnovel, Take a Lemon <
> http://www.takealemon.com
> > >,
> > > > and
> > > > > > >>> listen to the Misfile radio play <
> > > > > > >>> http://www.fuzzyfacetheater.com/misfile/>!
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>>
> > > > > > >>
> > > > > > >>
> > > > ---------------------------------------------------------------------
> > > > > > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > > > >> For additional commands, e-mail: users-help@maven.apache.org
> > > > > > >>
> > > > > > >>
> > > > > >
> > > > > > -----------------
> > > > > > Author, Getting Started with Apache Maven <
> > > > > > http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > > > >
> > > > > > Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> > > > > > and listen to the Misfile radio play <
> > > > > > http://www.fuzzyfacetheater.com/misfile/>!
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Andrew Pennebaker <ap...@42six.com>.
So close! I added the snippet inside my
<build><plugins>...</plugins></build> in pom.xml. Thanks for supplying the
exact code, by the way!

But jdb is showing an error:

$ mvn exec:exec -Djdb.mainClass=HelloMaven
Initializing jdb ...
> run
run HelloMaven
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
>
VM Started:
Exception occurred: java.lang.ClassNotFoundException
(uncaught)"thread=main", java.net.URLClassLoader$1.run(), line=202 bci=73

main[1]

This happens for any class I hand exec:exec.

This is the same error I see if I try to jdb <Class> manually.

Are we sure the <argument>-classpath</argument><classpath /> bit is the
correct way to hand jdb the CLASSPATH?


On Fri, Oct 11, 2013 at 4:20 PM, Curtis Rueden <ct...@wisc.edu> wrote:

> Hi Andrew,
>
> > Could you elaborate on the exact <plugin>...</plugin> snippet I would
> > need to drop into my pom.xml in order to achieve this?
>
> <plugin>
>   <groupId>org.codehaus.mojo</groupId>
>   <artifactId>exec-maven-plugin</artifactId>
>   <version>1.2.1</version>
>   <configuration>
>     <executable>jdb</executable>
>     <arguments>
>       <argument>-classpath</argument>
>       <classpath />
>       <argument>${jdb.mainClass}</argument>
>     </arguments>
>   </configuration>
>   <executions>
>     <execution>
>       <goals>
>         <goal>exec</goal>
>       </goals>
>     </execution>
>   </executions>
> </plugin>
>
> > If I could just `mvn exec:exec <Class>`, starting a jdb session on
> > <Class>.main(), that would be *perfect*.
>
> We can get close. If you use the block above, you would launch with:
>
>     mvn -Djdb.mainClass=<Class> exec:exec
>
> Where "jdb.mainClass" is the property used in the XML above. And if that is
> not concise enough for your taste you can choose a property with a shorter
> name.
>
> Working example inside a profile with a specific main class is here:
>
>
> https://github.com/imagej/imagej/commit/8cfe0fde7d89c71e083c992f5c7432b29f09c483
>
> Regards,
> Curtis
>
>
> On Fri, Oct 11, 2013 at 1:47 PM, Andrew Pennebaker <apennebaker@42six.com
> >wrote:
>
> > Thank you, Curtis, that looks like an excellent suggestion!
> >
> > Could you elaborate on the exact <plugin>...</plugin> snippet I would
> need
> > to drop into my pom.xml in order to achieve this?
> >
> > If I could just `mvn exec:exec <Class>`, starting a jdb session on
> > <Class>.main(), that would be *perfect*.
> >
> >
> > On Fri, Oct 11, 2013 at 1:20 PM, Curtis Rueden <ct...@wisc.edu>
> wrote:
> >
> > > Hi all,
> > >
> > > Rather than getting into an eclipse vs. vim vs. emacs flamewar, I'd
> > rather
> > > just ask: Andrew, did you try attaching your jdb to a running java
> > instance
> > > launched via exec-maven-plugin as I suggested yet?
> > >
> > > You can configure exec-maven-plugin in your pom so that launching the
> > > compatible java process is as easy as "mvn exec:exec". You could even
> > > specify jdb as the executable directly if that's what you want and then
> > you
> > > wouldn't even need the attachment step. Using profiles (yes, this is
> one
> > of
> > > their benign uses!) you can even set up multiple different behaviors of
> > > exec:exec for different common situations. Really I don't think there
> is
> > > any need whatsoever for a dedicated "mvn exec:jdb" here.
> > >
> > > -Curtis
> > > On Oct 11, 2013 10:53 AM, "Andrew Pennebaker" <ap...@42six.com>
> > > wrote:
> > >
> > > > Why would anyone want to do this? So we don't have to debug Maven
> > > projects
> > > > with Eclipse/IntelliJ, but the text editor of our choice. This is
> best
> > > > accomplished by Maven tasks which interact with the command line jdb
> > > tool.
> > > >
> > > >
> > > > On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <ru...@gold-family.us>
> > > wrote:
> > > >
> > > > > Why do you want to do that? I suspect we are not getting at your
> > actual
> > > > > requirement.
> > > > >
> > > > > On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <
> > apennebaker@42six.com>
> > > > > wrote:
> > > > >
> > > > > > Yes, various Java IDEs can debug Java code, including Java code
> > > > organized
> > > > > > in Maven projects. What I'm interested in is debugging Java code
> > in a
> > > > > Maven
> > > > > > project with an arbitrary text editor, not necessarily Eclipse or
> > > > > Intellij,
> > > > > > for example Emacs, or even Notepad, by invoking Maven tasks that
> > > point
> > > > to
> > > > > > Maven plugins that interact with jdb.
> > > > > >
> > > > > >
> > > > > > On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <
> > nsankaran@ebay.com
> > > >
> > > > > wrote:
> > > > > >
> > > > > >> It very is easy to debug maven from eclipse, I have documented
> > how I
> > > > > debug
> > > > > >> maven-jetty-plugin using eclipse
> > > > > >>
> > > > > >>
> > > > >
> > > >
> > >
> >
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
> > > > > >>
> > > > > >> -----Original Message-----
> > > > > >> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> > > > > >> Sent: Thursday, October 10, 2013 11:04 AM
> > > > > >> To: Maven Users List
> > > > > >> Subject: Re: Is there a Maven plugin for the Java debugger
> (jdb)?
> > > > > >>
> > > > > >> I could also use an IDE for package management, but I'd rather
> use
> > > > plain
> > > > > >> Maven and an arbitrary text editor instead.
> > > > > >>
> > > > > >>
> > > > > >> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <
> > russ@gold-family.us
> > > >
> > > > > >> wrote:
> > > > > >>
> > > > > >>> The simplest way to do this is actually to run it in your IDE
> > > > directly.
> > > > > >>> IntellijIDEA community edition can import your maven project
> and
> > > thus
> > > > > >>> get all of the dependencies. Then you just run the program in
> the
> > > > > >>> debugger. I presume Eclipse can do something similar.
> > > > > >>>
> > > > > >>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> > > > > >>> <ap...@42six.com>
> > > > > >>> wrote:
> > > > > >>>
> > > > > >>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that
> > > starts
> > > > > >>>> a
> > > > > >>> jdb
> > > > > >>>> session on <Class>.main().
> > > > > >>>>
> > > > > >>>> I can run jdb on individual Java code outside of a Maven
> > > structure,
> > > > > >>>> but
> > > > > >>> I'm
> > > > > >>>> not sure how to inform jdb of Java code in a Maven project,
> > > Maven's
> > > > > >>>> CLASSPATH handling, etc. etc.
> > > > > >>>>
> > > > > >>>>
> > > > > >>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > > > > >>> bimargulies@gmail.com>wrote:
> > > > > >>>>
> > > > > >>>>> What would that mean? Do you want to execute the program in
> the
> > > > > >>> debugger?
> > > > > >>>>>
> > > > > >>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> > > > > >>>>> <ap...@42six.com> wrote:
> > > > > >>>>>> I'd like to run jdb over some of my classes in a Maven
> > project.
> > > Is
> > > > > >>> there
> > > > > >>>>> a
> > > > > >>>>>> plugin I can drop into my pom.xml?
> > > > > >>>>>
> > > > > >>>>>
> > > -------------------------------------------------------------------
> > > > > >>>>> -- To unsubscribe, e-mail:
> users-unsubscribe@maven.apache.org
> > > > > >>>>> For additional commands, e-mail: users-help@maven.apache.org
> > > > > >>>>>
> > > > > >>>>>
> > > > > >>>
> > > > > >>> -----------------
> > > > > >>> Author, Getting Started with Apache Maven <
> > > > > >>>
> http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > > > >>>
> > > > > >>> Come read my webnovel, Take a Lemon <http://www.takealemon.com
> >,
> > > and
> > > > > >>> listen to the Misfile radio play <
> > > > > >>> http://www.fuzzyfacetheater.com/misfile/>!
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>>
> > > > > >>
> > > > > >>
> > > ---------------------------------------------------------------------
> > > > > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > > >> For additional commands, e-mail: users-help@maven.apache.org
> > > > > >>
> > > > > >>
> > > > >
> > > > > -----------------
> > > > > Author, Getting Started with Apache Maven <
> > > > > http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > > >
> > > > > Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> > > > > and listen to the Misfile radio play <
> > > > > http://www.fuzzyfacetheater.com/misfile/>!
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Andrew,

> Could you elaborate on the exact <plugin>...</plugin> snippet I would
> need to drop into my pom.xml in order to achieve this?

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>exec-maven-plugin</artifactId>
  <version>1.2.1</version>
  <configuration>
    <executable>jdb</executable>
    <arguments>
      <argument>-classpath</argument>
      <classpath />
      <argument>${jdb.mainClass}</argument>
    </arguments>
  </configuration>
  <executions>
    <execution>
      <goals>
        <goal>exec</goal>
      </goals>
    </execution>
  </executions>
</plugin>

> If I could just `mvn exec:exec <Class>`, starting a jdb session on
> <Class>.main(), that would be *perfect*.

We can get close. If you use the block above, you would launch with:

    mvn -Djdb.mainClass=<Class> exec:exec

Where "jdb.mainClass" is the property used in the XML above. And if that is
not concise enough for your taste you can choose a property with a shorter
name.

Working example inside a profile with a specific main class is here:

https://github.com/imagej/imagej/commit/8cfe0fde7d89c71e083c992f5c7432b29f09c483

Regards,
Curtis


On Fri, Oct 11, 2013 at 1:47 PM, Andrew Pennebaker <ap...@42six.com>wrote:

> Thank you, Curtis, that looks like an excellent suggestion!
>
> Could you elaborate on the exact <plugin>...</plugin> snippet I would need
> to drop into my pom.xml in order to achieve this?
>
> If I could just `mvn exec:exec <Class>`, starting a jdb session on
> <Class>.main(), that would be *perfect*.
>
>
> On Fri, Oct 11, 2013 at 1:20 PM, Curtis Rueden <ct...@wisc.edu> wrote:
>
> > Hi all,
> >
> > Rather than getting into an eclipse vs. vim vs. emacs flamewar, I'd
> rather
> > just ask: Andrew, did you try attaching your jdb to a running java
> instance
> > launched via exec-maven-plugin as I suggested yet?
> >
> > You can configure exec-maven-plugin in your pom so that launching the
> > compatible java process is as easy as "mvn exec:exec". You could even
> > specify jdb as the executable directly if that's what you want and then
> you
> > wouldn't even need the attachment step. Using profiles (yes, this is one
> of
> > their benign uses!) you can even set up multiple different behaviors of
> > exec:exec for different common situations. Really I don't think there is
> > any need whatsoever for a dedicated "mvn exec:jdb" here.
> >
> > -Curtis
> > On Oct 11, 2013 10:53 AM, "Andrew Pennebaker" <ap...@42six.com>
> > wrote:
> >
> > > Why would anyone want to do this? So we don't have to debug Maven
> > projects
> > > with Eclipse/IntelliJ, but the text editor of our choice. This is best
> > > accomplished by Maven tasks which interact with the command line jdb
> > tool.
> > >
> > >
> > > On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <ru...@gold-family.us>
> > wrote:
> > >
> > > > Why do you want to do that? I suspect we are not getting at your
> actual
> > > > requirement.
> > > >
> > > > On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <
> apennebaker@42six.com>
> > > > wrote:
> > > >
> > > > > Yes, various Java IDEs can debug Java code, including Java code
> > > organized
> > > > > in Maven projects. What I'm interested in is debugging Java code
> in a
> > > > Maven
> > > > > project with an arbitrary text editor, not necessarily Eclipse or
> > > > Intellij,
> > > > > for example Emacs, or even Notepad, by invoking Maven tasks that
> > point
> > > to
> > > > > Maven plugins that interact with jdb.
> > > > >
> > > > >
> > > > > On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <
> nsankaran@ebay.com
> > >
> > > > wrote:
> > > > >
> > > > >> It very is easy to debug maven from eclipse, I have documented
> how I
> > > > debug
> > > > >> maven-jetty-plugin using eclipse
> > > > >>
> > > > >>
> > > >
> > >
> >
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
> > > > >>
> > > > >> -----Original Message-----
> > > > >> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> > > > >> Sent: Thursday, October 10, 2013 11:04 AM
> > > > >> To: Maven Users List
> > > > >> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
> > > > >>
> > > > >> I could also use an IDE for package management, but I'd rather use
> > > plain
> > > > >> Maven and an arbitrary text editor instead.
> > > > >>
> > > > >>
> > > > >> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <
> russ@gold-family.us
> > >
> > > > >> wrote:
> > > > >>
> > > > >>> The simplest way to do this is actually to run it in your IDE
> > > directly.
> > > > >>> IntellijIDEA community edition can import your maven project and
> > thus
> > > > >>> get all of the dependencies. Then you just run the program in the
> > > > >>> debugger. I presume Eclipse can do something similar.
> > > > >>>
> > > > >>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> > > > >>> <ap...@42six.com>
> > > > >>> wrote:
> > > > >>>
> > > > >>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that
> > starts
> > > > >>>> a
> > > > >>> jdb
> > > > >>>> session on <Class>.main().
> > > > >>>>
> > > > >>>> I can run jdb on individual Java code outside of a Maven
> > structure,
> > > > >>>> but
> > > > >>> I'm
> > > > >>>> not sure how to inform jdb of Java code in a Maven project,
> > Maven's
> > > > >>>> CLASSPATH handling, etc. etc.
> > > > >>>>
> > > > >>>>
> > > > >>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > > > >>> bimargulies@gmail.com>wrote:
> > > > >>>>
> > > > >>>>> What would that mean? Do you want to execute the program in the
> > > > >>> debugger?
> > > > >>>>>
> > > > >>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> > > > >>>>> <ap...@42six.com> wrote:
> > > > >>>>>> I'd like to run jdb over some of my classes in a Maven
> project.
> > Is
> > > > >>> there
> > > > >>>>> a
> > > > >>>>>> plugin I can drop into my pom.xml?
> > > > >>>>>
> > > > >>>>>
> > -------------------------------------------------------------------
> > > > >>>>> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > >>>>> For additional commands, e-mail: users-help@maven.apache.org
> > > > >>>>>
> > > > >>>>>
> > > > >>>
> > > > >>> -----------------
> > > > >>> Author, Getting Started with Apache Maven <
> > > > >>> http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > > >>>
> > > > >>> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> > and
> > > > >>> listen to the Misfile radio play <
> > > > >>> http://www.fuzzyfacetheater.com/misfile/>!
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>>
> > > > >>
> > > > >>
> > ---------------------------------------------------------------------
> > > > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > >> For additional commands, e-mail: users-help@maven.apache.org
> > > > >>
> > > > >>
> > > >
> > > > -----------------
> > > > Author, Getting Started with Apache Maven <
> > > > http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > >
> > > > Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> > > > and listen to the Misfile radio play <
> > > > http://www.fuzzyfacetheater.com/misfile/>!
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
>

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Andrew Pennebaker <ap...@42six.com>.
Thank you, Curtis, that looks like an excellent suggestion!

Could you elaborate on the exact <plugin>...</plugin> snippet I would need
to drop into my pom.xml in order to achieve this?

If I could just `mvn exec:exec <Class>`, starting a jdb session on
<Class>.main(), that would be *perfect*.


On Fri, Oct 11, 2013 at 1:20 PM, Curtis Rueden <ct...@wisc.edu> wrote:

> Hi all,
>
> Rather than getting into an eclipse vs. vim vs. emacs flamewar, I'd rather
> just ask: Andrew, did you try attaching your jdb to a running java instance
> launched via exec-maven-plugin as I suggested yet?
>
> You can configure exec-maven-plugin in your pom so that launching the
> compatible java process is as easy as "mvn exec:exec". You could even
> specify jdb as the executable directly if that's what you want and then you
> wouldn't even need the attachment step. Using profiles (yes, this is one of
> their benign uses!) you can even set up multiple different behaviors of
> exec:exec for different common situations. Really I don't think there is
> any need whatsoever for a dedicated "mvn exec:jdb" here.
>
> -Curtis
> On Oct 11, 2013 10:53 AM, "Andrew Pennebaker" <ap...@42six.com>
> wrote:
>
> > Why would anyone want to do this? So we don't have to debug Maven
> projects
> > with Eclipse/IntelliJ, but the text editor of our choice. This is best
> > accomplished by Maven tasks which interact with the command line jdb
> tool.
> >
> >
> > On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <ru...@gold-family.us>
> wrote:
> >
> > > Why do you want to do that? I suspect we are not getting at your actual
> > > requirement.
> > >
> > > On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <ap...@42six.com>
> > > wrote:
> > >
> > > > Yes, various Java IDEs can debug Java code, including Java code
> > organized
> > > > in Maven projects. What I'm interested in is debugging Java code in a
> > > Maven
> > > > project with an arbitrary text editor, not necessarily Eclipse or
> > > Intellij,
> > > > for example Emacs, or even Notepad, by invoking Maven tasks that
> point
> > to
> > > > Maven plugins that interact with jdb.
> > > >
> > > >
> > > > On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <nsankaran@ebay.com
> >
> > > wrote:
> > > >
> > > >> It very is easy to debug maven from eclipse, I have documented how I
> > > debug
> > > >> maven-jetty-plugin using eclipse
> > > >>
> > > >>
> > >
> >
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
> > > >>
> > > >> -----Original Message-----
> > > >> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> > > >> Sent: Thursday, October 10, 2013 11:04 AM
> > > >> To: Maven Users List
> > > >> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
> > > >>
> > > >> I could also use an IDE for package management, but I'd rather use
> > plain
> > > >> Maven and an arbitrary text editor instead.
> > > >>
> > > >>
> > > >> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <russ@gold-family.us
> >
> > > >> wrote:
> > > >>
> > > >>> The simplest way to do this is actually to run it in your IDE
> > directly.
> > > >>> IntellijIDEA community edition can import your maven project and
> thus
> > > >>> get all of the dependencies. Then you just run the program in the
> > > >>> debugger. I presume Eclipse can do something similar.
> > > >>>
> > > >>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> > > >>> <ap...@42six.com>
> > > >>> wrote:
> > > >>>
> > > >>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that
> starts
> > > >>>> a
> > > >>> jdb
> > > >>>> session on <Class>.main().
> > > >>>>
> > > >>>> I can run jdb on individual Java code outside of a Maven
> structure,
> > > >>>> but
> > > >>> I'm
> > > >>>> not sure how to inform jdb of Java code in a Maven project,
> Maven's
> > > >>>> CLASSPATH handling, etc. etc.
> > > >>>>
> > > >>>>
> > > >>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > > >>> bimargulies@gmail.com>wrote:
> > > >>>>
> > > >>>>> What would that mean? Do you want to execute the program in the
> > > >>> debugger?
> > > >>>>>
> > > >>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> > > >>>>> <ap...@42six.com> wrote:
> > > >>>>>> I'd like to run jdb over some of my classes in a Maven project.
> Is
> > > >>> there
> > > >>>>> a
> > > >>>>>> plugin I can drop into my pom.xml?
> > > >>>>>
> > > >>>>>
> -------------------------------------------------------------------
> > > >>>>> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > >>>>> For additional commands, e-mail: users-help@maven.apache.org
> > > >>>>>
> > > >>>>>
> > > >>>
> > > >>> -----------------
> > > >>> Author, Getting Started with Apache Maven <
> > > >>> http://www.packtpub.com/getting-started-with-apache-maven/video>
> > > >>>
> > > >>> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> and
> > > >>> listen to the Misfile radio play <
> > > >>> http://www.fuzzyfacetheater.com/misfile/>!
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>>
> > > >>
> > > >>
> ---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > >> For additional commands, e-mail: users-help@maven.apache.org
> > > >>
> > > >>
> > >
> > > -----------------
> > > Author, Getting Started with Apache Maven <
> > > http://www.packtpub.com/getting-started-with-apache-maven/video>
> > >
> > > Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> > > and listen to the Misfile radio play <
> > > http://www.fuzzyfacetheater.com/misfile/>!
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
>

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi all,

Rather than getting into an eclipse vs. vim vs. emacs flamewar, I'd rather
just ask: Andrew, did you try attaching your jdb to a running java instance
launched via exec-maven-plugin as I suggested yet?

You can configure exec-maven-plugin in your pom so that launching the
compatible java process is as easy as "mvn exec:exec". You could even
specify jdb as the executable directly if that's what you want and then you
wouldn't even need the attachment step. Using profiles (yes, this is one of
their benign uses!) you can even set up multiple different behaviors of
exec:exec for different common situations. Really I don't think there is
any need whatsoever for a dedicated "mvn exec:jdb" here.

-Curtis
On Oct 11, 2013 10:53 AM, "Andrew Pennebaker" <ap...@42six.com> wrote:

> Why would anyone want to do this? So we don't have to debug Maven projects
> with Eclipse/IntelliJ, but the text editor of our choice. This is best
> accomplished by Maven tasks which interact with the command line jdb tool.
>
>
> On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <ru...@gold-family.us> wrote:
>
> > Why do you want to do that? I suspect we are not getting at your actual
> > requirement.
> >
> > On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <ap...@42six.com>
> > wrote:
> >
> > > Yes, various Java IDEs can debug Java code, including Java code
> organized
> > > in Maven projects. What I'm interested in is debugging Java code in a
> > Maven
> > > project with an arbitrary text editor, not necessarily Eclipse or
> > Intellij,
> > > for example Emacs, or even Notepad, by invoking Maven tasks that point
> to
> > > Maven plugins that interact with jdb.
> > >
> > >
> > > On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <ns...@ebay.com>
> > wrote:
> > >
> > >> It very is easy to debug maven from eclipse, I have documented how I
> > debug
> > >> maven-jetty-plugin using eclipse
> > >>
> > >>
> >
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
> > >>
> > >> -----Original Message-----
> > >> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> > >> Sent: Thursday, October 10, 2013 11:04 AM
> > >> To: Maven Users List
> > >> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
> > >>
> > >> I could also use an IDE for package management, but I'd rather use
> plain
> > >> Maven and an arbitrary text editor instead.
> > >>
> > >>
> > >> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <ru...@gold-family.us>
> > >> wrote:
> > >>
> > >>> The simplest way to do this is actually to run it in your IDE
> directly.
> > >>> IntellijIDEA community edition can import your maven project and thus
> > >>> get all of the dependencies. Then you just run the program in the
> > >>> debugger. I presume Eclipse can do something similar.
> > >>>
> > >>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> > >>> <ap...@42six.com>
> > >>> wrote:
> > >>>
> > >>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts
> > >>>> a
> > >>> jdb
> > >>>> session on <Class>.main().
> > >>>>
> > >>>> I can run jdb on individual Java code outside of a Maven structure,
> > >>>> but
> > >>> I'm
> > >>>> not sure how to inform jdb of Java code in a Maven project, Maven's
> > >>>> CLASSPATH handling, etc. etc.
> > >>>>
> > >>>>
> > >>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > >>> bimargulies@gmail.com>wrote:
> > >>>>
> > >>>>> What would that mean? Do you want to execute the program in the
> > >>> debugger?
> > >>>>>
> > >>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> > >>>>> <ap...@42six.com> wrote:
> > >>>>>> I'd like to run jdb over some of my classes in a Maven project. Is
> > >>> there
> > >>>>> a
> > >>>>>> plugin I can drop into my pom.xml?
> > >>>>>
> > >>>>> -------------------------------------------------------------------
> > >>>>> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >>>>> For additional commands, e-mail: users-help@maven.apache.org
> > >>>>>
> > >>>>>
> > >>>
> > >>> -----------------
> > >>> Author, Getting Started with Apache Maven <
> > >>> http://www.packtpub.com/getting-started-with-apache-maven/video>
> > >>>
> > >>> Come read my webnovel, Take a Lemon <http://www.takealemon.com>, and
> > >>> listen to the Misfile radio play <
> > >>> http://www.fuzzyfacetheater.com/misfile/>!
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> >
> > -----------------
> > Author, Getting Started with Apache Maven <
> > http://www.packtpub.com/getting-started-with-apache-maven/video>
> >
> > Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> > and listen to the Misfile radio play <
> > http://www.fuzzyfacetheater.com/misfile/>!
> >
> >
> >
> >
> >
> >
> >
> >
>

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Andrew Pennebaker <ap...@42six.com>.
Why would anyone want to do this? So we don't have to debug Maven projects
with Eclipse/IntelliJ, but the text editor of our choice. This is best
accomplished by Maven tasks which interact with the command line jdb tool.


On Thu, Oct 10, 2013 at 5:27 PM, Russell Gold <ru...@gold-family.us> wrote:

> Why do you want to do that? I suspect we are not getting at your actual
> requirement.
>
> On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <ap...@42six.com>
> wrote:
>
> > Yes, various Java IDEs can debug Java code, including Java code organized
> > in Maven projects. What I'm interested in is debugging Java code in a
> Maven
> > project with an arbitrary text editor, not necessarily Eclipse or
> Intellij,
> > for example Emacs, or even Notepad, by invoking Maven tasks that point to
> > Maven plugins that interact with jdb.
> >
> >
> > On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <ns...@ebay.com>
> wrote:
> >
> >> It very is easy to debug maven from eclipse, I have documented how I
> debug
> >> maven-jetty-plugin using eclipse
> >>
> >>
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
> >>
> >> -----Original Message-----
> >> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> >> Sent: Thursday, October 10, 2013 11:04 AM
> >> To: Maven Users List
> >> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
> >>
> >> I could also use an IDE for package management, but I'd rather use plain
> >> Maven and an arbitrary text editor instead.
> >>
> >>
> >> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <ru...@gold-family.us>
> >> wrote:
> >>
> >>> The simplest way to do this is actually to run it in your IDE directly.
> >>> IntellijIDEA community edition can import your maven project and thus
> >>> get all of the dependencies. Then you just run the program in the
> >>> debugger. I presume Eclipse can do something similar.
> >>>
> >>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> >>> <ap...@42six.com>
> >>> wrote:
> >>>
> >>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts
> >>>> a
> >>> jdb
> >>>> session on <Class>.main().
> >>>>
> >>>> I can run jdb on individual Java code outside of a Maven structure,
> >>>> but
> >>> I'm
> >>>> not sure how to inform jdb of Java code in a Maven project, Maven's
> >>>> CLASSPATH handling, etc. etc.
> >>>>
> >>>>
> >>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> >>> bimargulies@gmail.com>wrote:
> >>>>
> >>>>> What would that mean? Do you want to execute the program in the
> >>> debugger?
> >>>>>
> >>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> >>>>> <ap...@42six.com> wrote:
> >>>>>> I'd like to run jdb over some of my classes in a Maven project. Is
> >>> there
> >>>>> a
> >>>>>> plugin I can drop into my pom.xml?
> >>>>>
> >>>>> -------------------------------------------------------------------
> >>>>> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>
> >>>>>
> >>>
> >>> -----------------
> >>> Author, Getting Started with Apache Maven <
> >>> http://www.packtpub.com/getting-started-with-apache-maven/video>
> >>>
> >>> Come read my webnovel, Take a Lemon <http://www.takealemon.com>, and
> >>> listen to the Misfile radio play <
> >>> http://www.fuzzyfacetheater.com/misfile/>!
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
>
> -----------------
> Author, Getting Started with Apache Maven <
> http://www.packtpub.com/getting-started-with-apache-maven/video>
>
> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> and listen to the Misfile radio play <
> http://www.fuzzyfacetheater.com/misfile/>!
>
>
>
>
>
>
>
>

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Russell Gold <ru...@gold-family.us>.
Why do you want to do that? I suspect we are not getting at your actual requirement.

On Oct 10, 2013, at 2:25 PM, Andrew Pennebaker <ap...@42six.com> wrote:

> Yes, various Java IDEs can debug Java code, including Java code organized
> in Maven projects. What I'm interested in is debugging Java code in a Maven
> project with an arbitrary text editor, not necessarily Eclipse or Intellij,
> for example Emacs, or even Notepad, by invoking Maven tasks that point to
> Maven plugins that interact with jdb.
> 
> 
> On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <ns...@ebay.com> wrote:
> 
>> It very is easy to debug maven from eclipse, I have documented how I debug
>> maven-jetty-plugin using eclipse
>> 
>> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
>> 
>> -----Original Message-----
>> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
>> Sent: Thursday, October 10, 2013 11:04 AM
>> To: Maven Users List
>> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
>> 
>> I could also use an IDE for package management, but I'd rather use plain
>> Maven and an arbitrary text editor instead.
>> 
>> 
>> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <ru...@gold-family.us>
>> wrote:
>> 
>>> The simplest way to do this is actually to run it in your IDE directly.
>>> IntellijIDEA community edition can import your maven project and thus
>>> get all of the dependencies. Then you just run the program in the
>>> debugger. I presume Eclipse can do something similar.
>>> 
>>> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
>>> <ap...@42six.com>
>>> wrote:
>>> 
>>>> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts
>>>> a
>>> jdb
>>>> session on <Class>.main().
>>>> 
>>>> I can run jdb on individual Java code outside of a Maven structure,
>>>> but
>>> I'm
>>>> not sure how to inform jdb of Java code in a Maven project, Maven's
>>>> CLASSPATH handling, etc. etc.
>>>> 
>>>> 
>>>> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
>>> bimargulies@gmail.com>wrote:
>>>> 
>>>>> What would that mean? Do you want to execute the program in the
>>> debugger?
>>>>> 
>>>>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
>>>>> <ap...@42six.com> wrote:
>>>>>> I'd like to run jdb over some of my classes in a Maven project. Is
>>> there
>>>>> a
>>>>>> plugin I can drop into my pom.xml?
>>>>> 
>>>>> -------------------------------------------------------------------
>>>>> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>> 
>>>>> 
>>> 
>>> -----------------
>>> Author, Getting Started with Apache Maven <
>>> http://www.packtpub.com/getting-started-with-apache-maven/video>
>>> 
>>> Come read my webnovel, Take a Lemon <http://www.takealemon.com>, and
>>> listen to the Misfile radio play <
>>> http://www.fuzzyfacetheater.com/misfile/>!
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 

-----------------
Author, Getting Started with Apache Maven <http://www.packtpub.com/getting-started-with-apache-maven/video>

Come read my webnovel, Take a Lemon <http://www.takealemon.com>, 
and listen to the Misfile radio play <http://www.fuzzyfacetheater.com/misfile/>!








RE: Is there a Maven plugin for the Java debugger (jdb)?

Posted by "Sankaran, Nambi" <ns...@ebay.com>.
That is very interesting. 
It may be hard, because the line numbers in java byte code needs to associated with the lines numbers in the source file.
However, It may be possible to do that in emacs and vim.

-----Original Message-----
From: Andrew Pennebaker [mailto:apennebaker@42six.com] 
Sent: Thursday, October 10, 2013 11:26 AM
To: Maven Users List
Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?

Yes, various Java IDEs can debug Java code, including Java code organized in Maven projects. What I'm interested in is debugging Java code in a Maven project with an arbitrary text editor, not necessarily Eclipse or Intellij, for example Emacs, or even Notepad, by invoking Maven tasks that point to Maven plugins that interact with jdb.


On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <ns...@ebay.com> wrote:

> It very is easy to debug maven from eclipse, I have documented how I 
> debug maven-jetty-plugin using eclipse
>
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-wit
> h-maven/
>
> -----Original Message-----
> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> Sent: Thursday, October 10, 2013 11:04 AM
> To: Maven Users List
> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
>
> I could also use an IDE for package management, but I'd rather use 
> plain Maven and an arbitrary text editor instead.
>
>
> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <ru...@gold-family.us>
> wrote:
>
> > The simplest way to do this is actually to run it in your IDE directly.
> > IntellijIDEA community edition can import your maven project and 
> > thus get all of the dependencies. Then you just run the program in 
> > the debugger. I presume Eclipse can do something similar.
> >
> > On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker 
> > <ap...@42six.com>
> > wrote:
> >
> > > Yes. I'm looking for a task like `mvn jdb:debug <Class>` that 
> > > starts a
> > jdb
> > > session on <Class>.main().
> > >
> > > I can run jdb on individual Java code outside of a Maven 
> > > structure, but
> > I'm
> > > not sure how to inform jdb of Java code in a Maven project, 
> > > Maven's CLASSPATH handling, etc. etc.
> > >
> > >
> > > On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > bimargulies@gmail.com>wrote:
> > >
> > >> What would that mean? Do you want to execute the program in the
> > debugger?
> > >>
> > >> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker 
> > >> <ap...@42six.com> wrote:
> > >>> I'd like to run jdb over some of my classes in a Maven project. 
> > >>> Is
> > there
> > >> a
> > >>> plugin I can drop into my pom.xml?
> > >>
> > >> -----------------------------------------------------------------
> > >> --
> > >> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> >
> > -----------------
> > Author, Getting Started with Apache Maven < 
> > http://www.packtpub.com/getting-started-with-apache-maven/video>
> >
> > Come read my webnovel, Take a Lemon <http://www.takealemon.com>, and 
> > listen to the Misfile radio play < 
> > http://www.fuzzyfacetheater.com/misfile/>!
> >
> >
> >
> >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Andrew Pennebaker <ap...@42six.com>.
Yes, various Java IDEs can debug Java code, including Java code organized
in Maven projects. What I'm interested in is debugging Java code in a Maven
project with an arbitrary text editor, not necessarily Eclipse or Intellij,
for example Emacs, or even Notepad, by invoking Maven tasks that point to
Maven plugins that interact with jdb.


On Thu, Oct 10, 2013 at 2:09 PM, Sankaran, Nambi <ns...@ebay.com> wrote:

> It very is easy to debug maven from eclipse, I have documented how I debug
> maven-jetty-plugin using eclipse
>
> http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/
>
> -----Original Message-----
> From: Andrew Pennebaker [mailto:apennebaker@42six.com]
> Sent: Thursday, October 10, 2013 11:04 AM
> To: Maven Users List
> Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?
>
> I could also use an IDE for package management, but I'd rather use plain
> Maven and an arbitrary text editor instead.
>
>
> On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <ru...@gold-family.us>
> wrote:
>
> > The simplest way to do this is actually to run it in your IDE directly.
> > IntellijIDEA community edition can import your maven project and thus
> > get all of the dependencies. Then you just run the program in the
> > debugger. I presume Eclipse can do something similar.
> >
> > On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker
> > <ap...@42six.com>
> > wrote:
> >
> > > Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts
> > > a
> > jdb
> > > session on <Class>.main().
> > >
> > > I can run jdb on individual Java code outside of a Maven structure,
> > > but
> > I'm
> > > not sure how to inform jdb of Java code in a Maven project, Maven's
> > > CLASSPATH handling, etc. etc.
> > >
> > >
> > > On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> > bimargulies@gmail.com>wrote:
> > >
> > >> What would that mean? Do you want to execute the program in the
> > debugger?
> > >>
> > >> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> > >> <ap...@42six.com> wrote:
> > >>> I'd like to run jdb over some of my classes in a Maven project. Is
> > there
> > >> a
> > >>> plugin I can drop into my pom.xml?
> > >>
> > >> -------------------------------------------------------------------
> > >> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> >
> > -----------------
> > Author, Getting Started with Apache Maven <
> > http://www.packtpub.com/getting-started-with-apache-maven/video>
> >
> > Come read my webnovel, Take a Lemon <http://www.takealemon.com>, and
> > listen to the Misfile radio play <
> > http://www.fuzzyfacetheater.com/misfile/>!
> >
> >
> >
> >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Is there a Maven plugin for the Java debugger (jdb)?

Posted by "Sankaran, Nambi" <ns...@ebay.com>.
It very is easy to debug maven from eclipse, I have documented how I debug maven-jetty-plugin using eclipse
http://nambisankaran.wordpress.com/2012/06/30/running-jetty-server-with-maven/

-----Original Message-----
From: Andrew Pennebaker [mailto:apennebaker@42six.com] 
Sent: Thursday, October 10, 2013 11:04 AM
To: Maven Users List
Subject: Re: Is there a Maven plugin for the Java debugger (jdb)?

I could also use an IDE for package management, but I'd rather use plain Maven and an arbitrary text editor instead.


On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <ru...@gold-family.us> wrote:

> The simplest way to do this is actually to run it in your IDE directly.
> IntellijIDEA community edition can import your maven project and thus 
> get all of the dependencies. Then you just run the program in the 
> debugger. I presume Eclipse can do something similar.
>
> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker 
> <ap...@42six.com>
> wrote:
>
> > Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts 
> > a
> jdb
> > session on <Class>.main().
> >
> > I can run jdb on individual Java code outside of a Maven structure, 
> > but
> I'm
> > not sure how to inform jdb of Java code in a Maven project, Maven's 
> > CLASSPATH handling, etc. etc.
> >
> >
> > On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> bimargulies@gmail.com>wrote:
> >
> >> What would that mean? Do you want to execute the program in the
> debugger?
> >>
> >> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker 
> >> <ap...@42six.com> wrote:
> >>> I'd like to run jdb over some of my classes in a Maven project. Is
> there
> >> a
> >>> plugin I can drop into my pom.xml?
> >>
> >> -------------------------------------------------------------------
> >> -- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
>
> -----------------
> Author, Getting Started with Apache Maven < 
> http://www.packtpub.com/getting-started-with-apache-maven/video>
>
> Come read my webnovel, Take a Lemon <http://www.takealemon.com>, and 
> listen to the Misfile radio play < 
> http://www.fuzzyfacetheater.com/misfile/>!
>
>
>
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Andrew Pennebaker <ap...@42six.com>.
I could also use an IDE for package management, but I'd rather use plain
Maven and an arbitrary text editor instead.


On Thu, Oct 10, 2013 at 11:21 AM, Russell Gold <ru...@gold-family.us> wrote:

> The simplest way to do this is actually to run it in your IDE directly.
> IntellijIDEA community edition can import your maven project and thus get
> all of the dependencies. Then you just run the program in the debugger. I
> presume Eclipse can do something similar.
>
> On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker <ap...@42six.com>
> wrote:
>
> > Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts a
> jdb
> > session on <Class>.main().
> >
> > I can run jdb on individual Java code outside of a Maven structure, but
> I'm
> > not sure how to inform jdb of Java code in a Maven project, Maven's
> > CLASSPATH handling, etc. etc.
> >
> >
> > On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <
> bimargulies@gmail.com>wrote:
> >
> >> What would that mean? Do you want to execute the program in the
> debugger?
> >>
> >> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> >> <ap...@42six.com> wrote:
> >>> I'd like to run jdb over some of my classes in a Maven project. Is
> there
> >> a
> >>> plugin I can drop into my pom.xml?
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
>
> -----------------
> Author, Getting Started with Apache Maven <
> http://www.packtpub.com/getting-started-with-apache-maven/video>
>
> Come read my webnovel, Take a Lemon <http://www.takealemon.com>,
> and listen to the Misfile radio play <
> http://www.fuzzyfacetheater.com/misfile/>!
>
>
>
>
>
>
>
>

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Russell Gold <ru...@gold-family.us>.
The simplest way to do this is actually to run it in your IDE directly. IntellijIDEA community edition can import your maven project and thus get all of the dependencies. Then you just run the program in the debugger. I presume Eclipse can do something similar.

On Oct 10, 2013, at 10:52 AM, Andrew Pennebaker <ap...@42six.com> wrote:

> Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts a jdb
> session on <Class>.main().
> 
> I can run jdb on individual Java code outside of a Maven structure, but I'm
> not sure how to inform jdb of Java code in a Maven project, Maven's
> CLASSPATH handling, etc. etc.
> 
> 
> On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <bi...@gmail.com>wrote:
> 
>> What would that mean? Do you want to execute the program in the debugger?
>> 
>> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
>> <ap...@42six.com> wrote:
>>> I'd like to run jdb over some of my classes in a Maven project. Is there
>> a
>>> plugin I can drop into my pom.xml?
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 

-----------------
Author, Getting Started with Apache Maven <http://www.packtpub.com/getting-started-with-apache-maven/video>

Come read my webnovel, Take a Lemon <http://www.takealemon.com>, 
and listen to the Misfile radio play <http://www.fuzzyfacetheater.com/misfile/>!








Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Andrew Pennebaker <ap...@42six.com>.
Yes. I'm looking for a task like `mvn jdb:debug <Class>` that starts a jdb
session on <Class>.main().

I can run jdb on individual Java code outside of a Maven structure, but I'm
not sure how to inform jdb of Java code in a Maven project, Maven's
CLASSPATH handling, etc. etc.


On Thu, Oct 10, 2013 at 10:46 AM, Benson Margulies <bi...@gmail.com>wrote:

> What would that mean? Do you want to execute the program in the debugger?
>
> On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
> <ap...@42six.com> wrote:
> > I'd like to run jdb over some of my classes in a Maven project. Is there
> a
> > plugin I can drop into my pom.xml?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Is there a Maven plugin for the Java debugger (jdb)?

Posted by Benson Margulies <bi...@gmail.com>.
What would that mean? Do you want to execute the program in the debugger?

On Thu, Oct 10, 2013 at 10:38 AM, Andrew Pennebaker
<ap...@42six.com> wrote:
> I'd like to run jdb over some of my classes in a Maven project. Is there a
> plugin I can drop into my pom.xml?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org