Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 16F9E10CC1 for ; Mon, 14 Oct 2013 13:57:18 +0000 (UTC) Received: (qmail 88684 invoked by uid 500); 14 Oct 2013 13:57:12 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 88624 invoked by uid 500); 14 Oct 2013 13:57:06 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 88584 invoked by uid 99); 14 Oct 2013 13:57:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Oct 2013 13:57:04 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [74.125.245.82] (HELO na3sys010aog107.obsmtp.com) (74.125.245.82) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 14 Oct 2013 13:56:51 +0000 Received: from mail-ea0-f176.google.com ([209.85.215.176]) (using TLSv1) by na3sys010aob107.postini.com ([74.125.244.12]) with SMTP ID DSNKUlv4DS/fTO8p8BrXryQsHRL4i9FUhbms@postini.com; Mon, 14 Oct 2013 06:56:30 PDT Received: by mail-ea0-f176.google.com with SMTP id q16so3408961ead.35 for ; Mon, 14 Oct 2013 06:56:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=TM5HNUJhj67zVwTftKtma9/l91iFf4dSD+iLVW1U/kE=; b=kNmSJR8J3fC4aYr1dwy4Wk2ik5JkTluvGjSHod7HWXdQaERm6nYlwMlhrNWO2PEcSP HcLqpKtqj9rnYI8zMlyzYDOtF3QU584Z+wNxjcEgg8P1iBAB75a7J055+1/AN3zMweu9 jtIZmBtQnZ6+BLctb3565iFwDOLXx5W6iFBSxY2yNtbgQl3OxP6Wy+k4trjwXqSYG3r8 kFJjNabd5kHyl2dPZHSGXtXji6JY6GoZ5skvFJN26A3L7U0uv5UbtjLwEufiBjcbmmVv JH4miAcsh5tesbU+Mriq35/ZJKRjJ9X4TTB25qiI0LaBRYEJ/JSmAiQib4yJjIoQ9XrL mhmQ== X-Gm-Message-State: ALoCoQnJMph7teaicprOHqqi1Sen5zGwBljpPq7eQDp8odzARYaA/Vh5ia3REFX8+a7w7N32VLLrvenPvdH995/8ZW10EdO12icNqA8hmJzI9Oy1S2Rnsu6cm7FE7eaxFnvdcsH5YlM9ivybnr+Jy2hkItTD8Jymr8paehqXQTcFBVQtpW8NIEU= X-Received: by 10.15.93.204 with SMTP id w52mr2674952eez.69.1381758988628; Mon, 14 Oct 2013 06:56:28 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.15.93.204 with SMTP id w52mr2674927eez.69.1381758988408; Mon, 14 Oct 2013 06:56:28 -0700 (PDT) Received: by 10.14.151.71 with HTTP; Mon, 14 Oct 2013 06:56:28 -0700 (PDT) In-Reply-To: References: <6A1D99A77AC2F24CA6361492DE0BA130047AA7E6@PHX-EXRDA-S11.corp.ebay.com> <095DBCF4-ABD8-452E-B881-A69AA7A11785@gold-family.us> Date: Mon, 14 Oct 2013 09:56:28 -0400 Message-ID: Subject: Re: Is there a Maven plugin for the Java debugger (jdb)? From: Andrew Pennebaker To: Maven Users List Content-Type: multipart/alternative; boundary=089e01681486ab69a604e8b3d5c1 X-Virus-Checked: Checked by ClamAV on apache.org --089e01681486ab69a604e8b3d5c1 Content-Type: text/plain; charset=ISO-8859-1 So close! I added the snippet inside my ... 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 manually. Are we sure the -classpath bit is the correct way to hand jdb the CLASSPATH? On Fri, Oct 11, 2013 at 4:20 PM, Curtis Rueden wrote: > Hi Andrew, > > > Could you elaborate on the exact ... snippet I would > > need to drop into my pom.xml in order to achieve this? > > > org.codehaus.mojo > exec-maven-plugin > 1.2.1 > > jdb > > -classpath > > ${jdb.mainClass} > > > > > > exec > > > > > > > If I could just `mvn exec:exec `, starting a jdb session on > > .main(), that would be *perfect*. > > We can get close. If you use the block above, you would launch with: > > mvn -Djdb.mainClass= 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 >wrote: > > > Thank you, Curtis, that looks like an excellent suggestion! > > > > Could you elaborate on the exact ... snippet I would > need > > to drop into my pom.xml in order to achieve this? > > > > If I could just `mvn exec:exec `, starting a jdb session on > > .main(), that would be *perfect*. > > > > > > On Fri, Oct 11, 2013 at 1:20 PM, Curtis Rueden > 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" > > > 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 > > > 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 > > > > > >>> > > > > > >>> wrote: > > > > > >>> > > > > > >>>> Yes. I'm looking for a task like `mvn jdb:debug ` that > > > starts > > > > > >>>> a > > > > > >>> jdb > > > > > >>>> session on .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 > > > > > >>>>> 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 >, > > > 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 , > > > > > and listen to the Misfile radio play < > > > > > http://www.fuzzyfacetheater.com/misfile/>! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --089e01681486ab69a604e8b3d5c1--