Upload files from Eclipse Juno?

2019-07-15 12:39发布

问题:

I am building a new workspace in Ubuntu 12.10 with Eclipse Juno. I have configured my project, imported my files, established a local Git repo and synced it to a remote on GitHub. However, all my efforts to be able to upload files (php, html, css, and other website files) to servers have failed.

I have both Remote System Explorer (RSE) and Aptana Studio 3. Though I have successfully established connections both to localhost for testing and to my live webserver, none of my attempts to upload have succeeded.

Ideally, when I save any file in Eclipse, it would automatically be copied to my /var/www for my localhost test server. I have researched several sync options without success.

Additionally, I want to be able to use Ctrl+Shift+U or similar to upload the current file to my public server.

I have spent much of the last two days reading and researching, but have found minimal documentation, and blog entries are for obsolete versions.

I have no Deploy menu item, the Aptana Publish menu item is disabled, and if I use Eclipse's Export command from the right-click menu, and choose my localhost connection, I get error "Unable to use connection." This, despite being able to browse the contents in RSE's pane. When I try to export to the public server, the error is "This operation will remove previous team provider settings that were set for MyProjectName. Are you sure you want to do this?"

I am making the change to Eclipse for a more efficient workflow but so far it has cost me many days of frustration and I still can't upload a simple .html file?!

回答1:

Ok, as I understand it, you want to copy a file at save and upload it via FTP, yes?

You should look into Ant. You can configure Eclipse to run an Ant script when you save or build a project.

How to copy files with Ant

Ants FTP task

How to get ant to run when building a project



回答2:

this post might be helpful for you, if you use Eclipse RSE: How to synchronize files over FTP with Eclipse RSE?

Moreover they mention there some problems with jdk7 (for the older eclipse version). Check that too.

For the actions you to be performed automatically/on keypress, well for that I didn't find any quick solution.



标签: eclipse ftp