0
votes

Hi I am trying to trigger build for my Java application via JENKINS but getting following error:
An Ant BuildException has occured: Execute failed: java.io.IOException: Cannot run program "/export/home/buildadmin/.jenkins/jobs/HEAD/workspace/appName/wasDeploy.sh" (in directory "/export/home/buildadmin/.jenkins/jobs/HEAD/workspace/appName"): java.io.IOException: error=2, No such file or directory"
I have placed the wasDeploy.sh file in the above mentioned path but still getting the same error. Someone pleasee help me on this

3

3 Answers

0
votes

did you make wasDeploy.sh executable?

You can su to the jenkins user and try to run the file manually

0
votes

I have recently encountered the same problem and thought I should share my solution.

Please check the documentation, under the Description:

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

And here is how I used this solution in my 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>
0
votes

Add the path to sh file of Git in System Environment variables.

The path usually is C:\Program Files\Git\bin.