The Artima Developer Community
Sponsored Link

Scala Buzz
Run/Debug Lift Web App Using Scala/Maven Plugin for NetBeans

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Caoyuan Deng

Posts: 165
Nickname: dcaoyuan
Registered: Jan, 2008

Caoyuan Deng is an independent developer
Run/Debug Lift Web App Using Scala/Maven Plugin for NetBeans Posted: Aug 6, 2008 2:04 PM
Reply to this message Reply

This post originated from an RSS feed registered with Scala Buzz by Caoyuan Deng.
Original Post: Run/Debug Lift Web App Using Scala/Maven Plugin for NetBeans
Feed Title: Blogs about Scala from Caoyuan
Feed URL: http://blogtrader.org/page/dcaoyuan/feed/entries/atom?tags=scala
Feed Description: Blogs about Scala from Caoyuan Deng
Latest Scala Buzz Posts
Latest Scala Buzz Posts by Caoyuan Deng
Latest Posts From Blogs about Scala from Caoyuan

Advertisement

I'm a newbie to Maven, so I encountered some issues when run/debug Lift apps. The following are tips that I got, it may not be perfect, but at least work.

1. When pom.xml is changed, and classes not found errors happen on editor, you can close and reopen the project

This is a known issue, that I didn't refresh compiling context when pom.xml changed, thus the classpath dependency may be not refreshed at once, I'll fix this issue in the near future.

2. Run project by external Maven instead of embedded Maven of NetBeans plugin

I encountered "java.lang.NoClassDefFoundError org/codehaus/plexus/util/DirectoryScanner" when use embedded NetBeans Maven plugin (3.1.3) when invoke "Run" project, but fortunately, you can custom the binding actions in NetBeans Maven. The steps are:
  1. Right click project node, choose "Properties"
  2. Click on "Actions" in left-pane, choose "Use external Maven for build execution", and "set external Maven home"
  3. Choose "Run project" in right-pane, input "jetty:run"
  4. Choose "Debug project" in right-pane, input "jetty:run"

3. How to debug project

I'm a bit stupid here, since I don't like to change MAVEN_OPTS frequently. So I choose to do:

$ cd $MAVEN_HOME$/bin
$ cp mvn mvn.run
$ cp mvnDebug mvn

Then I invoke "Debug" action from NetBeans toolbar, and get NetBeans' output window saying:

WARNING: You are running Maven builds externally, some UI functionality will not be available.
Executing:/Users/dcaoyuan/apps/apache-maven-2.0.9/bin/mvn jetty:run
Preparing to Execute Maven in Debug Mode
Listening for transport dt_socket at address: 8000

Open menu "Debug" -> "Attach Debugger...", in the popped window, for "Port:", input "8000". Everything goes smoothly then. You add/remove breakpoints just as you are doing for a regular Scala project.

Of course, if you want to turn back to "Run" from "Debug", you have to "cp mvn.run mvn" back.

Anybody can give me hints on how to get this setting simple? in NetBeans Maven plugin.

Here's a snapshot: (click to enlarge it)

nn

Read: Run/Debug Lift Web App Using Scala/Maven Plugin for NetBeans

Topic: Scala Implicits: a dose of Magic | Part 1 Previous Topic   Next Topic Topic: Languages Readability and Tool Support

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use