8

How to refresh eclipse projects via command line?

(an equivalent of right-click > refresh in package view)
I need to refresh eclipse from a batch after a maven nightly build.

Philippe Blayo
  • 10,610
  • 14
  • 48
  • 65

1 Answers1

2

I know there are ant tasks to do this:

<eclipse.convertPath fileSystemPath="/workspace/org.example.project"
                     property="resourcePath"/>
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>

As for running this from the command line, as a worst case, you can stick this in an ant script invoke the eclipse antrunner application:

eclipse -nosplash -application org.eclipse.ant.core.antRunner -f refresh.xml

Philippe Blayo
  • 10,610
  • 14
  • 48
  • 65
Andrew Niefer
  • 4,279
  • 2
  • 19
  • 22
  • 6
    I've got an error: BUILD FAILED C:\...\refresh.xml:2: Unexpected element "{}eclipse.convertPath" {antlib:org.apache.tools.ant}eclipse.convertPath – Philippe Blayo May 07 '12 at 07:55
  • I also got it, how do I fix it? btw, I am in linux if that matters something – Zamir Sep 04 '14 at 11:04