Debugging an eclipse / maven project on a remote server?

No ssh-magic should really be required unless firewalls are a problem. Just get your project onto the remote somehow, and then run your build with mvnDebug instead of mvn Maven will listen for a debug connection on port 8000 by default and will wait until you've connected to proceed with the build. Configure a remote debugging launcher in Eclipse, and it will connect and debug like normal.As for getting the code across, you could use rsync but this is an excellent use case for git.

That's how I do this exact thing myself Edit: I've never looked for a way to do this with Eclipse, but you can run any arbitrary command from Eclipse, so rsync should work fine. With rsync, you'd want something like rsync -ruz . @:/G exclude=target After copying the project, you could start a build with ssh @ mvnDebug.

No ssh-magic should really be required unless firewalls are a problem. Just get your project onto the remote somehow, and then run your build with mvnDebug instead of mvn. Maven will listen for a debug connection on port 8000 by default and will wait until you've connected to proceed with the build.

Configure a remote debugging launcher in Eclipse, and it will connect and debug like normal. As for getting the code across, you could use rsync, but this is an excellent use case for git. That's how I do this exact thing myself.

Edit: I've never looked for a way to do this with Eclipse, but you can run any arbitrary command from Eclipse, so rsync should work fine. With rsync, you'd want something like rsync -ruz . @:/ Run that from your project directory, and it should copy the full content of the directory to on the remote host, only copying updated files after the initial copy.

You can exclude directories, like target, with the repeatable --exclude option. E.g. --exclude=target.

After copying the project, you could start a build with ssh @ mvnDebug The git way might seem a little more arcane if you aren't acquainted with git, but it has the additional benefit of being able to easily make fixes on the remote and pull them back to local. With git, you'd first log in to the remote with ssh, create a project directory, and git init it. AFter that, you can push changes to the remote at any time with git push -f @:/ master assuming you're working in master, and then on the remote: git reset --hard mvnDebug.

Just get your project onto the remote somehow" is the tricky part - I mean I don't want to do it by hand but just the eclipse way - by keystroke. Although I don't have any git experiences, what I don't want is to check out my source code on a remote host. – Jan Aug 12 at 14:16 Ryan gave you the correct solution.1.

Get your code over to that machine. 2. Make it compile 3. Run mvnDebug with jetty:run and attach to that VM.

That's it. – Michael-O Aug 12 at 15:18 Updated my answer. See if that helps.

– Ryan Stewart Aug 13 at 0:02 Thank you for your answer. It works well (I didn't use git, but rsync) for simple projects (one or some eclipse projects). I have troubles get the "enable workspace resolution" feature of m2eclipse working for the remote scenario but I'm working on it.

I try to intercept the java incocation and copy the class folders of dependant projects to the remote host, too. – Jan Aug 13 at 11:57.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions