How to let eclipse refresh the workspace - eclipse

I write a *bat-script to update my workspace projects to HEAD revision.
The problem is that I stil have to need refresh the workspace in project explorer of eclipse manually.
(Otherwise, new files want shown)
Can I use "External Configuration" or something like that to run my bat and after finished that eclipse refreshes the workspace?

You can use 'Run > External Tools > External Tools Configurations' to configure and run a Program.
This configuration has a 'Refresh' tab where you can configure the refresh action to take when the program finishes.

Related

Include Run Configurations in SVN project in MyEclipse

How can I configure MyEclipse and the SVN plugin (Subclipse 4.3.3) so that my Run Configurations are included in the source code control. Every time a new developer checks out the project, he doesn't have the Run Configurations needed to test the application properly or to do the Maven packaging correctly.
Is there a way?
To share your run/launch configuration, go to the launch configuration (Run > Run Configurations...) tab Common for Save as choose Shared file (instead of Local file).
In addition, you can choose to Display in favorites menu to add it to the drop-down of the corresponding button in the main toolbar.

Eclipse not automatically refreshing resources in src/main/resources

In my Eclipse preferences, I have "Refresh using native hooks or polling" selected.
If I make a change to a Java file outside of Eclipse, the project that contains that Java file automatically refreshes and rebuilds that file as it should. However, if I make a change to a file under src/main/resources/... from an external editor, it is not automatically refreshed. I have to select the project and press F5 to get it to refresh.
Is there a way to configure Eclipse to automatically refresh any resources under src/main/resources?
In Eclipse
Run > External Tools > External Tools Configuration
Create a new Program configuration Point the location to an exe that is very fast
On the Refresh tab, choose Refresh Resources upon completion, The Entire Workspace
On the Build tab, deselect Build before launch

Running ANT targets using .launch file

In one of my legacy project ant target is invoved from *.launch file. This file contains <launchConfiguration> tag and one of the attribute name "type" is ant class org.eclipse.ant.ANTLaunchConfigurationType, different parameter are set using this tag. When this launch file is executed in eclipse, one of the ANT target is executed specified in launchConfiguration tag.
I am not able to find any information around this functionality of ANT. Only relevant thread found is, which is unanswered
Running eclipse ant targets from an external command
I am not able to understand how launch files are created and how to set parameter to launchConfiguration tag.
The .launch files are created by Eclipse for every Run Configuration you want to be saved:
Open Eclipse.
Select a build.xml file.
Through the context menu, execute Run as/Ant build.... A dialog appears.
If you want to pass parameters to the Ant script, you have to fulfil the Arguments area (in the Main tab) like this:
-Darg1=value1
-Darg2=value2
...
Then, go to the Common Tab and focus on the Share file field: With the Browse button, select your project. This will create the .launch file into your project, and let it available for further executions. (You should rename it).
Execute Run.
You can edit the .launch configuration in menu Run>External tools>External tools configuration.
Note: Within the Run Configuration, you'd better spend some minutes reading all the parameters available in all the tabs. For example, in the Build tab, you can set if you want a project to be build before your script is executed (If not, unchecking the checkbox may save you a lot of time). Or in the Refresh tab, you can select which project directories you want to be refreshed after the script is executed, etc.
Launch configurations for Ant Builds are created and managed using the 'Run > External Tools > External Tools Configurations...' dialog.
You can import existing .launch files using 'File > Import... > Run/Debug > Launch Configurations'

External Tool Configuration build options tab in Eclipse > Luna (i.e. Mars)

I had a supercool hook set up on Eclipse to compile my project's .css theme file from its .less modules every time a .less module was modified by monitoring those resources through an "external tool configuration".
I could select which resources to monitor for triggering the nodejs less compiler tool on the launch configurations build options tab.
On eclipse Mars there is no such tab.
It really bothers me to loose this automation. Does anybody know where did that tab go or how can I keep this functionality without it?
You set up such custom builders via the project's Properties dialog. Open the properties, then select the Builders section. There you can use the New... button to configure a Program to run as a builder.

eclipse, refresh files edited by external editor

I currently use emacs to edit .java files and run eclipse.
Eclipse doesn't automatically recognize modified files, so I often end up running unmodified application.
I wonder if there exists a shortcut to refresh all the modified files in eclipse.
Perhaps you want to check Preferences > General > Workspaces > Refresh using native hooks or polling. You can see that the eclipse refreshes the file you edit with external editor (like vi, emacs, etc) when you check the option.
On the project explorer you need to select the project(s) that you want to refresh and then click on File->Refresh or hit F5.