Eclipse在保存时自动上传,无需Aptana [英] Eclipse Auto-Upload on Save, Without Aptana

查看:88
本文介绍了Eclipse在保存时自动上传,无需Aptana的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Eclipse开发网站,并且我不想在本地计算机上运行Apache,PHP和MySQL。我已经设置了一个远程Linux服务器来执行此操作。但是,我想要的是每次保存文件时,Eclipse都应该将该文件上传到Linux服务器。 Dreamweaver在此任务上做得绝对完美,但是我更喜欢Eclipse中的许多其他功能。

I'm using Eclipse to develop a website, and I don't want to run Apache, PHP, and MySQL on my local computer. I already have a remote Linux server set up to do that. What I want though, is every time I save a file, Eclipse should upload that file to the Linux server. Dreamweaver does an absolutely perfect job at this task, but I prefer many other features in Eclipse.

我很清楚在Stack Overflow上有很多关于此的文章话题。我已经审查了它们,但似乎都不能完全满足我的需求。我将介绍所有已知的可能性,并讨论为什么它们不太正确:

I am well aware that there are many, many posts on Stack Overflow about this topic. I have reviewed them, but none seem to quite meet my needs. I'll go through all the possibilities I know about, and talk about why they're not quite right:


  1. Aptana -我在问题的标题中专门排除了这一点。是的,它可以满足我的要求,但是如果将其安装为Eclipse插件,则它将完全接管您的Eclipse。我只想要这一功能,而不是整个800磅重的大猩猩会改变一切。

  1. Aptana - I specifically excluded this in the question's title. Yes, it does what I'm asking for, but if you install it as an Eclipse plugin, it totally takes over your Eclipse. I only want this one feature, not the whole 800-pound gorilla that changes everything.

远程系统资源管理器-我想要主要版本位于我的硬盘驱动器上,而不是远程服务器上。这是因为我想更快地打开文件并完成代码。

Remote System Explorer - I want the primary version to be on my hard drive, not the remote server. This is because I want faster file open, and code completion.

GIT或SVN -当我看到其他人问这个问题时在Stack Overflow上,通常会回答使用Git或SVN。好吧,我已经在使用Git。当我想同步整个项目,而不仅仅是对一个文件进行迭代时,我将使用Git进行同步。但是,如果您只想看到所做的更改,那么独立的Git太慢了。我也不想看到无意义的提交。下面提到的PTP稍好一些,但速度还不够快。

GIT or SVN - When I see other people ask this question on Stack Overflow, someone usually answers "use Git or SVN." Well, I'm already using Git. When I want to sync the entire project, and not just iterate on one file, I will do it using Git. But standalone Git is way too slow if all you want to do is see your changes working. I also don't want to see hundreds of meaningless commits. PTP, mentioned below, is a little better and a little faster, but not fast enough.

PTP -这是Eclipse似乎没有太多人知道​​的插件。它具有使用Git同步本地文件夹和远程文件夹的功能,并且每次您单击保存时都可以自动执行此操作。这绝对很棒,但不幸的是有点慢。当我在Dreamweaver中单击保存时,更改将在不到一秒钟的时间内上传到服务器。 PTP Git操作在一个很小的项目上需要10秒钟,我敢打赌,对于一个更大的项目,等待会变得更大。我非常相信超快速迭代,而所有PTP等待都会使我慢下来。

PTP - This is an Eclipse plugin that not too many people seem to know about. It has the ability to sync a local folder and a remote folder using Git, and it can do it automatically every time you hit save. This is absolutely awesome, but unfortunately a little slow. When I hit save in Dreamweaver, the change is uploaded to the server in less than one second. The PTP Git operation takes 10 seconds on a tiny project, and I bet that wait gets larger with a larger project. I'm a huge believer in super-fast iteration, and all that PTP waiting will really slow me down.

WebDAV和Eclipse的FTP支持-似乎不再积极开发它。

WebDAV and FTP support for Eclipse - It seems like this is no longer actively developed.

FileSync -非常简洁,但仅支持本地文件系统文件夹。

FileSync - Pretty neat, but only supports local filesystem folders.

我还有其他选择吗?还是我的要求如此具体,以至于没有什么适合我。似乎会有其他人想要完全一样的东西。

Are there any other options that I've overlooked? Or are my requirements so specific that there's nothing that fits me right. It seems like there would be other people who want exactly the same thing.

推荐答案

这是我的建议,并不是快速的方法

在eclipse中,您可以设置外部工具。这意味着,您可以将php / java脚本文件设置为外部程序,并发送一些eclipse给您的参数( $ {resource_loc} $ {project_name} $ {resource_path} )。

因此,通过脚本文件,您可以登录SSH或FTP或您想要的任何内容并同步您的文件或具有远程系统的项目。

仅在eclipse中的外部工具配置窗口中,您必须将Location设置为/ usr / bin / php
,在Arguments中,可以使用eclipse变量将脚本路径设置为脚本args。

最后,如果可能,应为外部程序分配一些短键。

This is my suggestion and it is not quick way to do this, but very customizable.
In eclipse you can set external tools.That means, you can set a php/java script file as external program and send some params that eclipse gives you(${resource_loc} ${project_name} ${resource_path}).
So with script file you can login to SSH or FTP or what ever you want and sync your file or project with remote system.
Just in External Tools Configuration window in eclipse you must set Location to /usr/bin/php and in Arguments, you can set script path with eclipse variables as script args.
At last you should assign some short key to external program IF Possible.

这篇关于Eclipse在保存时自动上传,无需Aptana的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆