Skip to main content

Version: 23.10

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.

AttributeDescription
srcString

Required. The path to the service definition file.

Specify either a src attribute or fileset element.

fileString

Required if multiple is false. The output service archive ZIP file.

multipleString

Denotes whether to place each service in separate archive ZIP files.

dirString

Required if multiple is true. The output directory in which to place archive ZIP files for multiple services.

tmVersionString

The target TM version for service compatibility packaging.

TM servers older than 4.3.4 do not support the `groovyDebugLogging` bindable service parameter.

versionString

Required. The service version number.

debugBoolean

If 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.

AttributeDescription
dirString

Required. The base directory of a configuration to package multiple service definitions in the same service archive.

The include element recognises the following attributes.

AttributeDescription
nameString

Required. A file name or file mask identifying service definition JSON files.

The service definition files are located in the directory specified by the dir attribute of the containing fileset element.

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>