I'm getting a NullPointerException when running the maven-assembly-plugin. It appears to be caused by a particular section of my assembly. How can I do source-level debugging of this plugin so I can narrow down the problem?
I'm using Eclipse and M2E.
To start with, you could run maven with -X option. This would give a lot of debug info. If this is insufficient, you could use mvnDebug. This page details how to do this using Eclipse.
Related
I am currently working on eclipse plug-in that involves many modules, and I would like to debug and run this eclipse plug-in from IntelliJ.I open this project in IntelliJ to edit code but when I have to run/debug this project I have to open eclipse IDE and start it from there. How can I use IntelliJ to do this?
I haven't actually tried this ... but you could try launching the RCP application stand alone but with the remote debug parameters specified for in your application's .ini file.
Then just point IntelliJ to the appropriate source and attach it's debugger to the running app.
Why do you want to do that? Eclipse has multiple tools for the plugin development that you will miss in IntelliJ. Also you need to build your plugin as product headless and then attach a debugger to it.
In my opinion it doesn't worth the effort. I would install Eclipse and devolop with eclipse.
I often found myself in a situation where I would like to see exactly which Maven commands Eclipse is running behind the scenes. In this case I am running a webapp with WTP, but this question is more general (though I would gladly accept answers for just that scenario).
Is there any way either with a pom configuration or an Eclipse configuration to view a log of all commands (and potentially any output) that any Eclipse plugin (or at least m2eclipse-wtp) have run?
The Maven Console will show you the Maven output from m2e and m2eclipse - access it from the very right hand side dropdown of the normal Console view.
In Eclipse UI, I got the following problem,
If you see left side, the classes are available. I am able to build using Maven and run it successfully. But this Eclipse error highlighting is really annoying.
I am using Eclipse Indigo SR2 and installed Spring Tool Suite. Please help me on fixing this issue. Thanks.
try importing com.beatle.model.* and see what happens
I come from a background in C++, Python, and Django and I'm trying to expand my horizons and learn Scala and Lift. However, I'm having a really hard time figuring out how to debug Lift applications using eclipse.
I can create projects using some of the lift sbt templates and run them no problem. However, I haven't been able to start the application from within Eclipse because it can't find Jetty, and as a result, I'm not able to use the debugger to step through the Lift code. Weeks of googling haven't helped much.
Could someone share their methods or suggestions? I'm also new to the jvm, so feel free to share best practices or point out important differences that I may be missing.
Ok, I've gotten this figured out.
So I'm not actually launching the application from the Eclipse debugger. I'm starting the application through sbt, and then connecting the Eclipse remote debugger to the sbt vm that's running the webapp.
Here's what I did:
Assuming you have sbt-launch.jar in /bin:
Create the file /bin/sbt_debug with permission to execute and containing this line:
java -Xmx512M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar /bin/sbt-launch.jar "$#"
What this script is doing is starting sbt and instructing the jvm to allow debugging on port 5005
Go to your lift project directory in your terminal and enter sbt_debug. Once you're in the sbt console enter container:start / container:update or ~jetty:start / ~jetty:update depending on which version of sbt you're using.
Next go to Eclipse, click the debug icon and select "Debug Configurations..."
On the left column, click "Remote Java Application" and create a new debug configuration. Set the Port to 5005.
Hit the Debug button and the Eclipse debugger should now be debugging the sbt process you started earlier
Note: This is the first method that has worked for me. If you have one that is better, please share
I've found the most useful tools to be the SBT Eclipse Plugin and the RunJettyRun plugin for Eclipse. The former will allow you to generate Eclipse config files based on your SBT setup and the latter will launch Jetty from Eclipse with the debugger attached. An added bonus is that generating your Eclipse config using "eclipse with-source=true" from the SBT prompt will download and attach src jars as well so you can step through Lift and any other 3rd party libraries you depend on as well as your own code.
Eclipse can some times fail to load plugins. I have experienced this E3.7 with both ScalaIDE and GroovyEclipse.
In both cases some times the syntax highlighting fails. Also I have noticed some times plugin related menu items and popups do not appear. This is very much evident when you use the Pulse Eclipse distribution.
This is aggregated after using Eclipse of a while and going through a few updates. Some times a clean unzip and a download of the required plugin solve the issue.
Is there a way to get around these issues?
What are the problems with the plugins? Are they not found at all, or do they fail to load?
When you start up Eclipse, open the view "Plug-in Registry", find the plugin that causes problems and select to diagnose the plugin. This will determine if there are some dependencies that arent satisfied.
How have you installed the plugins? The correct way to do this is to use update sites. Just downloading and unzipping into the plugins catalog is not recommended.
There is also a trick to start up an OSGI console to diagnose plugins, see my answer here
This page can also provide some more help.