0
votes

I am using Spring official docs to understand the Spring Basic Application and Environment set up on Linux using Ant.

Softwares and system configurations:

  • OS: Linux/Ubuntu
  • JRE: 1.8.0_51-b16
  • Ant Version: 1.9.3
  • IDE: Luna Service Release 1 (4.4.1)

Project directory structure:

enter image description here

Everything goes fine till end of Section 1.3 where I can start the tomcat server and execute ant, ant deploy successfully and I have the desired output as follows:

enter image description here

enter image description here

But when I am trying to execute ant list - the build fails.

Buildfile: /home/sandeep/MyDocs/workspace/springapp/build.xml

list:

BUILD FAILED
/home/sandeep/MyDocs/workspace/springapp/build.xml:113: Problem: failed to create task or type list
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.

Here is the list target in my build.xml:

<target name="list" description="List Tomcat applications">
    <list url="${tomcat.manager.url}"
        username="${tomcat.manager.username}"
        password="${tomcat.manager.password}"/>
</target>

What am I doing wrong here? Here is a link to my entire build.xml.

2

2 Answers

1
votes

In the article you linked to, it shows how to add the <list> task:

<taskdef name="list" classname="org.apache.catalina.ant.ListTask">
    <classpath refid="catalina-ant-classpath"/>
</taskdef>

Add the above line to your build.xml.

0
votes

I think task list is unknown to ant. There is no task named list defined by ant. To start tomcat I did something like --

    <exec executable="${tomcat.home}/bin/tomcat5.exe" >
        <arg value="start"/>
        <env key="JAVA_OPTS"
             value="-Xint -Xdebug -Xrunjdwp:transport=dt_socket,address=${hotswap.port},server=y,suspend=n"/>
    </exec>
</target>