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 |
---|---|
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 Name | Task Class |
---|---|
WaspPackager | com.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>
Attribute Name | Description | Required | Command-line Option |
---|---|---|---|
classDirectory | A comma-separated list of class directories. The same as the classDirectory sub-element. | No | --classpath |
clientPackage | If set to true, the client package will be created. | No | --client |
descriptor | Specifies a custom deployment descriptor. | No | --deployment-descriptor |
exclude | Sets 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 |
force | Overwrites 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 |
generateWSDL | If set to true, the task generates a wsdl for each service listed in the deployment descriptor. | No | --generate-wsdl-dd |
include | Sets the mask for files that should be packed into the output file. It restricts the set specified with the classDirectory attribute. | No | --include |
isLibrary | Sets a flag that determines whether this package is a shared library. | No | --library |
jarFile | Sets the name of the JAR file that will be generated. | Yes | --output |
library | A comma-separated list of libraries to be added to the package. Equivalent to the library sub-element. | No | --lib |
license | Sets the license for the package. | No | --license |
packageVersion | Sets the version of the package. | No | --package-version |
protocol | Specifies 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 |
servicePackage | Sets the name of the service package. | Yes | --package |
targetNamespace | Sets the target namespace of the package. | No | --tns |
validate | Validates custom deployment descriptor against XML Schema. | No | --validate |
validateMessages | Validate messages against XML schema. Possible values: "", "in out", "in", "out" | No | --validate-messages |
wsdlFile | If you want to include a custom WSDL file in the package, use this attribute. Value = path to WSDL file. | No | --wsdl-file |
Describes a package on which the created package depends.
Attribute of depends | Description | Required | Command-line Option |
---|---|---|---|
packageQName | Contains the QName of the package on which the created package depends. | Yes | --depends |
minVersion | Contains the minimum version number of the package on which the created package depends. | Yes | --min-version |
Use classDirectory when adding a directory to the package.
Attribute of classDirectory | Description | Required | Command-line Option |
---|---|---|---|
name | Name of the directory to be added | Yes | --add |
Use library when adding a JAR file to the package
Attribute of library | Description | Required | Command-line Option |
---|---|---|---|
name | Name of the JAR file to be added | Yes | --lib |
Use otherFile when adding a file to the package.
Attribute of otherFile | Description | Required | Command-line Option |
---|---|---|---|
name | Name of file to be added | Yes | --add |
context | Path of the directory where the file will be stored | Yes | --prefix |
The service element describes a service to be deployed. There may be any number of these elements in the WaspPackager task.
Attribute of service | Description | Required | Command-line Option |
---|---|---|---|
attachmentType | Sets attachment type as MIME or DIME. Default is MIME. | No | --attachment-type |
class | Fully qualified name of the implementation class | Yes | --class |
name | Service name | Yes | --service-name |
path | Service path (URI) | Yes | --uri |
generateWSDL | Determines whether a wsdl file will be generated for the service. | No | --generate-wsdl |
protocol | Specifies 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 |
validateMessages | Validate messages against XML schema. Possible values: "", "in out", "in", "out" | No | --validate-messages dir |
wsdlFile | The name of a custom wsdl file | No | --wsdl-file |
service | The name of a service within a custom wsdl | No | --wsdl-service |
SoapBindingStyle | rpc or document. Default is document. | No | --soap-binding-style |
SoapEncodingStyle | literal or encoded. Default is literal. | No | --soap-encoding-style |