2013-06-20 32 views
0

嗨我正試圖通過JENKINS觸發構建Java應用程序,但出現以下錯誤:
Ant BuildException發生:執行失敗:java.io.IOException:無法運行程序「/export/home/buildadmin/.jenkins/jobs/HEAD/workspace/appName/wasDeploy.sh」(在目錄「/ export/home/buildadmin /.jenkins/jobs/HEAD/workspace/appName「):java.io.IOException:error = 2,沒有這樣的文件或目錄」
我已經將wasDeploy.sh文件放在上面提到的路徑中,但仍然得到相同的錯誤。有人請幫我在這「通過Jenkins進行構建時發生Ant BuildException:執行失敗:java.io.IOException:無法運行程序」

回答

0

你做的是德ploy.sh可執行文件?

您可以su到詹金斯用戶,並嘗試運行該文件手動

+0

Ya..I正在運行從EAR POM文件這個文件這是我在pom.xml中的代碼 \t \t \t \t \t \t 驗證 \t \t \t \t \t \t <結構> \t \t \t \t \t \t \t <任務名稱= 「生成RMIC和部署代碼」> \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t 運行 \t \t \t \t \t \t \t \t \t \t \t user1782009

+0

不知道如果這是你的問題,但你定義$ {BASEDIR}作爲目錄,並在可執行文件。你的工作真的叫做appName嗎? – KeepCalmAndCarryOn

+0

$ {basedir}是我需要選擇wasDeploy.sh文件的目錄路徑。並且不想透露我的CLENT名稱這就是爲什麼我已經在這裏給作業名稱作爲'appName'。 – user1782009

0

我最近遇到同樣的問題,我想我應該分享我的解決方案。

請檢查documentation,則說明下:

<property name="executable-full-path" 
      location="../relative/path/to/executable"/> 
<exec executable="${executable-full-path}" ... 

這裏是我如何用我的POM此解決方案:

<plugin> 
    <groupId>org.apache.maven.plugins</groupId> 
    <artifactId>maven-antrun-plugin</artifactId> 
    <executions> 
     <execution> 
      <id>expand-package</id> 
      <phase>generate-test-sources</phase> 
      <goals> 
       <goal>run</goal> 
      </goals> 
      <configuration> 
       <tasks> 
        <property name="executable-full-path" location="../test" /> 
        <exec executable="${executable-full-path}/restart_service.sh" /> 
       </tasks> 
      </configuration> 
     </execution> 

    </executions> 
</plugin> 
相關問題