ANT WaspPackager Task  Locate

Overview  Locate

The WaspPackager ANT Task is for launching the WaspPackager command-line tool in Apache ANT. WaspPackager is used to prepare a Java package for deployment as a service. It generates the .jar file used in deployment and adds the requisite deployment descriptor and WSDL files to it. More details on this tool are given in WaspPackager.

[Note]Note

Examples You can find examples of the use of ANT tasks in WASP_HOME/src/example/tools/ant and in the build.xml files in Demos. See also Example 220

Task NameTask Class
WaspPackagercom.idoox.wasp.tools.ant.WaspPackagerTask

Example 220. WaspPackager ANT Task

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="main" name="test">
    <taskdef classname="com.idoox.wasp.tools.ant.WaspPackagerTask" 
    name="waspPackager"/>
    <target name="main">
        <waspPackager classDirectory="C:\work\build" jarFile="../test.jar"
            library="C:\work\debug.jar" servicePackage="testPackage" 
            targetNamespace="targetNamespace">
            <service class="test.TestClass" name="s1" path="/s1/"/>
            <service class="demo.helloworld.service.HelloWorldService" 
            name="s2" path="/s2/"/>
            <library name="C:\work\xerces.jar"/>
            <library name="C:\work\wasp-advanced.jar"/>
            <classDirectory name="C:\work\classes"/>
            <otherFile context="html" name="c:\work\doc\index.html"/>
        </waspPackager>
    </target>
</project>

Attributes of the WaspPackager ANT Task  Locate

Attribute NameDescriptionRequiredCommand-line Option
classDirectoryA comma-separated list of class directories. The same as the classDirectory sub-element.No--classpath
clientPackageIf set to true, the client package will be created.No--client
descriptorSpecifies a custom deployment descriptor.No--deployment-descriptor
excludeSets the mask for files that should not be packed into the output file. It restricts the set specified with the classDirectory attribute and with the include attribute.No--exclude
forceOverwrites existing file, when a file with same path as the file being generated exists already. This prevents File already exists-type errors. (=true/false) No--force
generateWSDLIf set to true, the task generates a wsdl for each service listed in the deployment descriptor.No--generate-wsdl-dd
includeSets the mask for files that should be packed into the output file. It restricts the set specified with the classDirectory attribute.No--include
isLibrarySets a flag that determines whether this package is a shared library.No--library
jarFileSets the name of the JAR file that will be generated.Yes--output
libraryA comma-separated list of libraries to be added to the package. Equivalent to the library sub-element.No--lib
licenseSets the license for the package.No--license
packageVersionSets the version of the package.No--package-version
protocolSpecifies the protocol for the services within the package. The value may be soap11, soap12 or soap11 soap12 (both). If this attribute is not set, the protocol will be determined by the configuration file.No--protocol
servicePackageSets the name of the service package.Yes--package
targetNamespaceSets the target namespace of the package.No--tns
validateValidates custom deployment descriptor against XML Schema.No--validate
validateMessagesValidate messages against XML schema. Possible values: "", "in out", "in", "out"No--validate-messages
wsdlFileIf you want to include a custom WSDL file in the package, use this attribute. Value = path to WSDL file.No--wsdl-file

Sub-elements of the WaspPackager task  Locate

<depends>   Locate

Describes a package on which the created package depends.

Attribute of dependsDescriptionRequiredCommand-line Option
packageQNameContains the QName of the package on which the created package depends.Yes--depends
minVersionContains the minimum version number of the package on which the created package depends.Yes--min-version
<classDirectory>   Locate

Use classDirectory when adding a directory to the package.

Attribute of classDirectoryDescriptionRequiredCommand-line Option
nameName of the directory to be addedYes--add
<library>   Locate

Use library when adding a JAR file to the package

Attribute of libraryDescriptionRequiredCommand-line Option
nameName of the JAR file to be addedYes--lib
<otherFile>   Locate

Use otherFile when adding a file to the package.

Attribute of otherFileDescriptionRequiredCommand-line Option
nameName of file to be addedYes--add
contextPath of the directory where the file will be storedYes--prefix
<service>   Locate

The service element describes a service to be deployed. There may be any number of these elements in the WaspPackager task.

Attribute of serviceDescriptionRequiredCommand-line Option
attachmentTypeSets attachment type as MIME or DIME. Default is MIME.No--attachment-type
classFully qualified name of the implementation classYes--class
nameService nameYes--service-name
pathService path (URI)Yes--uri
generateWSDLDetermines whether a wsdl file will be generated for the service.No--generate-wsdl
protocolSpecifies the protocol for the services within the package. The value may be soap11, soap12 or soap11 soap12 (both). If this attribute is not set, the protocol will be determined by the configuration file.No--protocol
validateMessagesValidate messages against XML schema. Possible values: "", "in out", "in", "out"No--validate-messages dir
wsdlFileThe name of a custom wsdl fileNo--wsdl-file
serviceThe name of a service within a custom wsdlNo--wsdl-service
SoapBindingStylerpc or document. Default is document.No--soap-binding-style
SoapEncodingStyleliteral or encoded. Default is literal.No--soap-encoding-style