svc-package
The svc-package task creates a service archive for a given service project.
Task Structure
The structure of the svc-package task element is shown below.
<svc-package ... >
<fileset dir=... >
<include name=... />
</fileset>
</svc-package>
The fileset element is an Ant FileSet. For detailed information, see FileSet Type - Apache Ant.
Task Attributes
All attributes are optional unless otherwise indicated.
| Attribute | Description |
|---|---|
src | StringRequired. The path to the service definition file. Specify either a |
file | StringRequired if |
multiple | StringDenotes whether to place each service in separate archive ZIP files. |
dir | StringRequired if |
tmVersion | StringThe target TM version for service compatibility packaging. TM servers older than 4.3.4 do not support the `groovyDebugLogging` bindable service parameter. |
version | StringRequired. The service version number. |
debug | BooleanIf true then a copy of the service archive XML in the target directory. optional |
The task can also be configured to ignore the clearOnExport service definition parameter, which prevents any service parameter values being included in the service archive ZIP file, by setting the JVM arg -DignoreClearOnExport=true. This option is useful for running unit tests with test parameter values which you may not want included in the final service build.
The fileset element recognises the following attributes.
| Attribute | Description |
|---|---|
dir | StringRequired. The base directory of a configuration to package multiple service definitions in the same service archive. |
The include element recognises the following attributes.
| Attribute | Description |
|---|---|
name | StringRequired. A file name or file mask identifying service definition JSON files. The service definition files are located in the directory specified by the If using a file mask to filter files, ensure it only selects service definition JSON files. |
Example
The example Ant task below creates a service archive ZIP file for a single service definition specified by the src attribute. The file attribute specifies the target service archive ZIP file output.
<svc-package file="target/trackme-service.zip"
src="src/trackme-dd/service-def.json"
version="1.0.0" />
The example Ant task below creates a service archive ZIP file containing multiple service definitions as specified by the fileset attribute. The file attribute specifies the target service archive ZIP file output.
<svc-package file="target/trackme-services.zip">
<fileset dir="src">
<include name="**/service-def.json"/>
</fileset>
</svc-package>
The example Ant task below creates archive ZIP files for multiple services, each containing a service definition specified by the fileset attribute. The dir attribute specifies the target directory where services archives ZIP files output.
<svc-package dir="target/"
multiple="true">
<fileset dir="src">
<include name="**/service-def.json"/>
</fileset>
</svc-package>