S.Dev.AG
S.Dev.AG

Reputation: 31

can't run sqlplus from Jenkins

I'm trying to run an ant target using an apply tag with the executable property set to sqlplus but I'm getting this error:

Execute failed: java.io.IOException: Cannot run program "sqlplus" (in directory "D:\builds\xxxx"): CreateProcess error=2, The system cannot find the file specified

My build xml file look like this:

<target name="xxxx">
    <apply dir="${root.dir}/test" executable="sqlplus" failonerror="true" output="${logs.dir}/xxxx.log">
        <arg line="${db.user}/${db.pass}@${db.direct}" />
        <srcfile prefix="@"/>
        <fileset dir="${root.dir}/tests" casesensitive="false">
            <include name="xxxx.sql"/>
        </fileset>
    </apply>  
</target>

I m using Jenkins with Invoke Ant and I have sqlplus installed on my build machine.

Upvotes: 1

Views: 1607

Answers (1)

S.Dev.AG
S.Dev.AG

Reputation: 31

It's Working Now. I created an environment variable sqlplus containing the url to sqlplus.exe. Then I used it in my ant file.

<apply dir="${root.dir}/test" executable="${env.sqlplus}" ...>

Upvotes: 1

Related Questions