Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate Sublime Text with Tomcat

At work, we develop Java applications and are using Eclipse. As a frontend dev I would like to switch completely to Sublime, but it's missing a feature of Eclipse, I can't work without it.

When developing, I had to build the project with Maven and publish it to a Tomcat server. Eclipse does this all automatically and also republish changed files.

I came so far, building the app with Maven and publish it to Tomcat with the Maven-Tomcat plugin. But with Tomcat 7 republishing isn't possible and changed files aren't copied to the working directory. So I have to leave Eclipse open and refresh its workspace everytime I changed files in Sublime.

Would it be possible to integrate this functionality into Sublime with any plugin?

like image 540
BiliWeiss Avatar asked Apr 20 '13 09:04

BiliWeiss


4 Answers

Rather than deploy to a specific Tomcat 7 container that you ave set up yourself, I would instead use tomcat7:run to start a live container based on the unpackaged web app.

That should get you pretty much exactly what you are after.

If you don't mind switching to jetty as a server container jszip:run can get you even more, but I'm still working on getting that plugin to beta quality so ymmv

like image 148
Stephen Connolly Avatar answered Nov 15 '22 10:11

Stephen Connolly


What about this plugin https://github.com/nlloyd/SublimeMaven? I'll try it tommorow and then I'll let you know if it do the job (if it will work with ST3).

like image 30
Marek Ka. Avatar answered Nov 15 '22 11:11

Marek Ka.


Eclipse has a feature for this. Select "Refresh using native hooks or polling" and "Refresh on access". You should select both. I have tried only selecting "Refresh using native hooks or polling", but it works only when you keep open the specific file in eclipse and modifying it outside. "Refresh on access" also not working alone. With these options combined it works charmingly.

enter image description here

PS: Native hooks available only in Windows. For Linux and Mac polling is used. I don't know how efficient it is.

like image 41
Kapil Dev S Avatar answered Nov 15 '22 11:11

Kapil Dev S


I had this problem too. The workaround, is to open both eclipse and sublime, and instead of refreshing your project manually in eclipse every time you have made some changes in sublime, u can can use this plugin https://github.com/psxpaul/EclipseJava7Refresher to make the refresh automatically.

PS : As mentioned by @Kapil Dev S, eclipse (with "Refresh using native hooks or polling" checked ) can refresh automatically resources when changed, but it doesn't detect changes as soon as it happens (it takes some seconds, at least for me on Linux)

like image 32
Naghmouchi Omar Avatar answered Nov 15 '22 11:11

Naghmouchi Omar