WSDD Builder Gradle Plugin

The WSDD Builder Gradle plugin lets you run the Liferay WSDD Builder tool to generate the Apache Axis Web Service Deployment Descriptor (WSDD) files from a Service Builder service.xml file.

The plugin has been successfully tested with Gradle 4.10.2.

Usage

To use the plugin, include it in your build script:

buildscript {
    dependencies {
        classpath group: "com.liferay", name: "com.liferay.gradle.plugins.wsdd.builder", version: "1.0.13"
    }

    repositories {
        maven {
            url "https://repository-cdn.liferay.com/nexus/content/groups/public"
        }
    }
}

apply plugin: "com.liferay.portal.tools.wsdd.builder"

The WSDD Builder plugin automatically applies the java plugin.

Since the plugin automatically resolves the Liferay WSDD Builder library as a dependency, you have to configure a repository that hosts the library and its transitive dependencies. The Liferay CDN repository hosts them all:

repositories {
    maven {
        url "https://repository-cdn.liferay.com/nexus/content/groups/public"
	}
}

Tasks

The plugin adds one task to your project:

NameDepends OnTypeDescription
buildWSDDcompileJavaBuildWSDDTaskRuns the Liferay WSDD Builder.

By default, the buildWSDD task uses the ${project.projectDir}/service.xml file as input. Then, it generates ${project.projectDir}/server-config.wsdd and the *_deploy.wsdd and *_undeploy.wsdd files in the first resources directory of the main source set (by default: src/main/resources).

If the war plugin is applied, the task uses ${project.webAppDir}/WEB-INF/service.xml as input to generate ${project.webAppDir}/WEB-INF/server-config.wsdd. The *_deploy.wsdd and *_undeploy.wsdd files are still generated in the first resources directory of the main source set.

Liferay WSDD Build Service requires an additional classpath (configured with the buildWSDD.builderClasspath property), to correctly generate the WSDD files. The buildWSDD task uses the following default value, which creates an implicit dependency to the compileJava task:

tasks.compileJava.outputs.files + sourceSets.main.compileClasspath + sourceSets.main.runtimeClasspath

BuildWSDDTask

Tasks of type BuildWSDDTask extend JavaExec, so all its properties and methods, such as args and maxHeapSize, are available. They also have the following properties set by default:

Property NameDefault Value
argsWSDD Builder command line arguments
classpathproject.configurations.wsddBuilder
main"com.liferay.portal.tools.wsdd.builder.WSDDBuilder"

Task Properties

Property NameTypeDefault ValueDescription
builderClasspathStringnullA classpath that the Liferay WSDD Builder uses to generate WSDD files. It sets the wsdd.class.path argument.
inputFileFilenullA service.xml from which to generate the WSDD files. It sets the wsdd.input.file argument.
outputDirFilenullA directory where the *_deploy.wsdd and *_undeploy.wsdd files are generated. It sets the wsdd.output.path argument.
serverConfigFileFile${project.projectDir}/server-config.wsddA server-config.wsdd file to generate. It sets the wsdd.server.config.file argument.
serviceNamespaceString"Plugin"A namespace for the WSDD Service. It sets the wsdd.service.namespace argument.

The properties of type File support any type that can be resolved by project.file. Moreover, it is possible to use Closures and Callables as values for the String properties, to defer evaluation until task execution.

Additional Configuration

There are additional configurations that can help you use the WSDD Builder.

Liferay WSDD Builder Dependency

By default, the plugin creates a configuration called wsddBuilder and adds a dependency to the latest released version of the Liferay WSDD Builder. It is possible to override this setting and use a specific version of the tool by manually adding a dependency to the wsddBuilder configuration:

dependencies {
    wsddBuilder group: "com.liferay", name: "com.liferay.portal.tools.wsdd.builder", version: "1.0.10"
}
Was this article helpful?
0 out of 0 found this helpful