Eclipse Auto-Upload on Save, Without Aptana(保存时 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:
Aptana - 我在问题标题中明确排除了这一点.是的,它可以满足我的要求,但是如果您将它作为 Eclipse 插件安装,它会完全接管您的 Eclipse.我只想要这个功能,而不是改变一切的整个 800 磅的大猩猩.
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.
Eclipse 的 WebDAV 和 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 的外部工具配置窗口中,您必须将位置设置为/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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:保存时 Eclipse 自动上传,没有 Aptana
基础教程推荐
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- 如何对 HashSet 进行排序? 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01
- 在螺旋中写一个字符串 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01