SoapUI Tests with Ant+Ivy Andrei Solntsev, 17 Apr 2012

Do you like quest games? Everybody likes! Today we had to play one. It's name was "run SoapUI tests with ANT script".

SoapUI is de-facto number 1 tool for testing SOA services. It's yound enough to have Maven 2 plugin, and it's old enough to have Maven 1 plugin. But we are not lucky enough: SoapUI doesn't have Ant task. This article shows how to run SoapUI tests from Ant script.We suppose you are already using Ivy. So, let's begin.

Ant script

Ant task is simple enough:

<target name="test">
    <mkdir dir="test-results"/>
    <java classname="" errorproperty="tests-failed" fork="yes" dir="test-results">
      <arg line="-j -f${basedir}/test-results"/>
      <arg value="-t${basedir}/soapui-settings.xml"/>
      <arg value="${basedir}/MY-SMART-soapui-project.xml"/>
        <fileset dir="lib" includes="*.jar"/>

    <junitreport todir="test-results">
      <fileset dir="test-results">
        <include name="TEST-*.xml"/>
      <report format="frames" todir="reports/html"/>

    <fail if="tests-failed"/>

Ivy configuration

Next, you need to add corresponding dependencies to ivy.xml:

<dependencies defaultconf="default->default">
    <dependency org="junit" name="junit" rev="4.10+" />
    <dependency org="eviware" name="maven-soapui-plugin" rev="4.0.1" />
    <dependency org="net.sf.jtidy" name="jtidy" rev="r938+"/>
    <exclude org="jtidy" module="jtidy"/>

And finally, you need to add repository to your ivysettings.xml:

  <settings defaultResolver="default"/>

    <ibiblio name="public" m2compatible="true"/>
    <ibiblio name="eviware" m2compatible="true" root=""/>
    <chain name="default" returnFirst="true">
      <resolver ref="eviware"/>
      <resolver ref="public"/>

Yes, eviware should come first, because it overrides some artifacts from the central repository, e.g. javax.jms:jms.

SoapUI settings

Typically all tests have some configuration parameters. It's common to declare them in SoapUI's global properties. Fortunately, these can be stored in VCS in file soapui-settings.xml:

<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-settings xmlns:con="">
  <con:setting id="GlobalPropertySettings@properties"><![CDATA[<xml-fragment xmlns:con="">
  <property xmlns="">


Execute ant test and be prepared for download ~60 MB of jars. I have no idea why SoapUI needs so much (for example, why it needs javax.jms?), but that's Java, guys. After running, you will find JUnit-style html reports in folder reports/html. And several log files in the test-results folder.


Missing dependencies

Since eviware repo overrides some artifacts from the central repository, you can get in trouble if some artifacts are already cached in your local repository. For example, we have get this problem with javax.jms:jms artifact.

[ivy:retrieve] :::: WARNINGS
[ivy:retrieve] [NOT FOUND] javax.jms#jms;1.1!jms.jar (0ms)
[ivy:retrieve] ==== public: tried
[ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] :: FAILED DOWNLOADS ::
[ivy:retrieve] :: ^ see resolution messages for details ^ ::
[ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] :: javax.jms#jms;1.1!jms.jar
[ivy:retrieve] ::::::::::::::::::::::::::::::::::::::::::::::

Workaround is simple: rm -fr ~/.ivy2/cache/javax.jms/jms


Though SOA concept is offspring of the devil, SoapUI is a great tool for testing this, and automated testing is a great practice. Putting them together is a good level for programmer's quest game. Maven repository is inevitable beast of satan at the end of level. Be patient and kill this boss.