views:

61

answers:

2

I have a maven plugin generating some code for eclipse to build, but I have to manually refresh the project before eclipse sees the code.

How can I make eclipse automatically refresh the project as part of the build?

I'm trying to use a custom builder, but it wants to run a command (which I don't need to do).

A: 

Depending on how you run your Maven plugin, it may just refresh the project automatically. That is how it normally works in m2eclipse.

Also, you can configure a custom builder Project Properties / Builders / New... / Program and select some dummy command to run (e.g. C:\cygwin\bin\date.exe) and then configure project refresh settings.

Eugene Kuleshov
I tried this, but It needs to work across platforms. I don't know that I can enter a dummy command that will work with Windows, Linux, and Mac OSX.
ScArcher2
If you have cygwin installed on Windows, an sh script may work. But then again, how are you running your maven plugin in a first place?
Eugene Kuleshov
+3  A: 

You can make eclipse automatically refresh your whole workspace: Window->Preferences->General->Workspace and check "Refresh automatically"

Avall
I think that only refreshes on startup and shutdown. I tried it and it did not automatically refresh it after I did a project / clean.
ScArcher2
I use it daily, since I use ant-scripts and other external programs to modify the content of my workspace, and it works fine for me. I do however not know how it works; if it continuously polls the directory tree (and how often) or something smarter...
Avall