Deployment Helper Gradle Plugin

The Deployment Helper Gradle plugin lets you run the Liferay Deployment Helper tool to create a cluster deployable WAR from your OSGi artifacts.

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.deployment.helper", version: "1.0.5"
    }

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

apply plugin: "com.liferay.deployment.helper"

Since the plugin automatically resolves the Liferay Deployment Helper 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
buildDeploymentHelper-BuildDeploymentHelperTaskBuilds a WAR which contains one or more files that are copied once the WAR is deployed.

BuildDeploymentHelperTask

Tasks of type BuildDeploymentHelperTask 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
argsThe Deployment Helper command line arguments.
classpathproject.configurations.deploymentHelper
deploymentFilesThe output files of the jar tasks of this project and all its sub-projects.
main"com.liferay.deployment.helper.DeploymentHelper"
outputFile"${project.buildDir}/${project.name}.war"

Task Properties

Property NameTypeDefault ValueDescription
deploymentFilesFileCollection[]The files or directories to include in the WAR and copy once the WAR is deployed. If a directory is added to this collection, all the JAR files contained in the directory are included in the WAR.
deploymentPathFilenullThe directory to which the included files are copied.
outputFileFilenullThe WAR file to build.

The properties of type File support any type that can be resolved by project.file.

Task Methods

MethodDescription
BuildDeploymentHelperTask deploymentFiles(Iterable<?> deploymentFiles)Adds files or directories to include in the WAR and copy once the WAR is deployed. The values are evaluated as per project.files.
BuildDeploymentHelperTask deploymentFiles(Object... deploymentFiles)Adds files or directories to include in the WAR and copy once the WAR is deployed. The values are evaluated as per project.files.

Additional Configuration

There are additional configurations that can help you use the Deployment Helper.

Liferay Deployment Helper Dependency

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

dependencies {
    deploymentHelper group: "com.liferay", name: "com.liferay.deployment.helper", version: "1.0.4"
}
¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0