2013-04-24 61 views
2

我嘗試刷新日食作爲Powershell-script的最後一步。我位於「.../My_Project」,而.xml文件位於「.../My_Project/base/cmd」中。因此,最後一行是用腳本使用ant刷新Eclipse,找不到項目

C:\app\eclipse_juno_SR2\eclipse -nosplash -application org.eclipse.ant.core.antRunner -f .\base\cmd\refresh.xml -consolelog 

而且劇本我用的是

<?xml version="1.0" encoding="UTF-8"?> 
<project name="refresh_project" default="refresh" basedir="./../.."> 
<target name="refresh"> 
    <eclipse.refreshLocal resource="/My_Project" depth="infinite"/> 
</target> 
</project> 

,當我使用它在Eclipse中,構建工程,但使用它只是顯示這個消息的腳本時:

org.eclipse.m2e.logback.configuration: The org.eclipse.m2e.logback.configuration 
bundle was activated before the state location was initialized. Will retry aft 
er the state location is initialized. 
org.eclipse.m2e.logback.configuration: Logback config file: C:\Users\Dennis.Hert 
el\workspace\.metadata\.plugins\org.eclipse.m2e.logback.configuration\logback.1. 
3.0.20130129-0926.xml 
org.eclipse.m2e.logback.configuration: Initializing logback 
org.eclipse.m2e.logback.configuration: eclipse.consoleLog=true 
Buildfile: .\base\cmd\refresh.xml 

refresh: 
[eclipse.refreshLocal] Warning: project /My_Project does not exist and cannot be 
refreshed. 
BUILD SUCCESSFUL 

我試圖

  1. 幾個幻燈CTS
  2. eclipse.convertPath fileSystemPath="/My_Project"
  3. property="Test" fileSystemPath="/${workspace_loc}/My_Project"
  4. fileSystemPath="/${workspace_loc:My_Project}"
  5. fileSystemPath="/path/to/my/project/My_Project"
  6. 使用其他環境變量和使用${Test}作爲資源

但它要麼不展開變量(工作區)或拋出錯誤,因爲路徑無效(它不是)或沒有任何變化

請原諒,如果這是一個愚蠢的問題,我正在工作幾個小時,我從來沒有用過螞蟻,並希望我不像我想的那麼愚蠢

回答

1

我的猜測是工作區您正在運行您的ant腳本的Eclipse實例與項目所在的工作空間不同。爲了解決這個問題,請確保在啓動ant腳本時指定Eclipse工作區位置。您可以使用osgi.instance.area系統屬性從啓動腳本

-Dosgi.instance.area=/path/to/my/workspace 

Here is a complete description of the command line option.

命令設置工作區位置
相關問題